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/

    How to get the index of the current iteration in next?

    General Code/Help
    2
    3
    28
    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.
    • B
      BorutF last edited by

      Hello,

      I am very new to Backtrader, hence I have a pretty simple question.

      I understand you use self.data.low[0] to get let's say the low value of the current iteration, as 0 is the index by which you access the current data.

      But how do you the index of the current iteration? Let's say you are at the 100th example in the time-series. Where do you access this value?

      Best Regards,

      Borut

      run-out 1 Reply Last reply Reply Quote 0
      • run-out
        run-out @BorutF last edited by

        @borutf You can get the current bar but using len(self)

        B 1 Reply Last reply Reply Quote 2
        • B
          BorutF @run-out last edited by

          @run-out said in How to get the index of the current iteration in next?:

          @borutf You can get the current bar but using len(self)

          Thanks.

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