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 can you tell if a Line Coupler has incremented

    General Code/Help
    2
    5
    414
    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.
    • D
      deedy last edited by

      In my Indicator's next() method (incrementing on an hourly scale) I want to check whether my Line Coupler (which I have passed in - daily scale) has just incremented from the previous call to next.

      So the calls to next() in my Indicator go:

      i = 22 (10:00pm)
      i = 23 (11:00pm)
      i = 24 (0:00am) ----> next day. LineCoupler gives a new value

      Is there a property on a LineCoupler or some other way I can determine this?

      Many thanks

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        Use its len as for any other object which has lines.

        1 Reply Last reply Reply Quote 0
        • D
          deedy last edited by

          I've tried that but the length is the same as the higher frequency data

          1 Reply Last reply Reply Quote 0
          • B
            backtrader administrators last edited by

            Because the Coupler runs on the same timeframe as the larger timeframe and changes when that changes.

            You are apparently not looking for the change in the coupler then.

            1 Reply Last reply Reply Quote 0
            • D
              deedy last edited by

              Correct. I thought there may be a property on the coupler which has access to the original array. I am now using a timer and I think that is much simpler. Thank you for clearing that up

              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(); }); }