Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Multi core indicator processing

    Indicators/Strategies/Analyzers
    multi core
    3
    6
    154
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • André Tavares
      André Tavares last edited by

      I am developing a strategy that tests cointegration for a list of 100 companies. I create an object of the indicator for each pair.
      When the strategy is processing the method next for the indicator it processes each indicator at a time.
      Is it possible to process them using all cores?

      1 Reply Last reply Reply Quote 0
      • André Tavares
        André Tavares last edited by

        I seams the answer is no, as I have been looking at the code. How ever if I could multiprocess the lines below in lineiterator.py it would work.
        Does anyone knows how I can multiprocess this to paralyze indicator analysis?

        def _once(self):
                    self.forward(size=self._clock.buflen())
                    for indicator in self._lineiterators[LineIterator.IndType]:
                       indicator._once()
        

        @ab_trader I have seen you are active in this forum. Sorry to call you directly, but do you know how to solve this?

        A 1 Reply Last reply Reply Quote 0
        • A
          ab_trader @André Tavares last edited by

          @André-Tavares I don't know

          1 Reply Last reply Reply Quote 0
          • André Tavares
            André Tavares last edited by

            @backtrader any thoughts on how to speed up this part?

            1 Reply Last reply Reply Quote 0
            • vladisld
              vladisld last edited by

              I'm not sure the multiprocessor package is the way to go here because of possible data/indicators dependencies that need to be satisfied while calculating the indicator values (in case you are going to provide a fully generic solution).

              Anyway, this could easily require relatively serious development and re-design (even if you are talking about completely independent indicator/data line calculations).

              If you have some design in mind, please share - it could be an interesting proposal.

              André Tavares 1 Reply Last reply Reply Quote 0
              • André Tavares
                André Tavares @vladisld last edited by

                @vladisld I don't have it. I have been trying to change the code to allow multiprocessing but it did not work.

                Another thing I could do to achieve my goal would be to instead of passing to the strategy a list of companies, I could tell it 2 companies and make an optimization of the strategy. This way I would achieve multiprocessing. However I would like to have an analysis of the whole strategy with all pairs together, and doing this I will have the results per pair.
                Is it possible to merge Analyzers in order to see all pairs results together?

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
                $(document).ready(function () { app.coldLoad(); }); }