Backtrader Community

    • 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/

    replay H1 bar using M1 data and call function at new H1 bar

    General Code/Help
    1
    2
    36
    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.
    • gowestyang
      gowestyang last edited by

      Hello!

      I'm replaying H1 bar using M1 data:
      cerebro.replaydata(data, timeframe=bt.TimeFrame.Minutes, compression=60)

      When calling next(), the function runs at a new M1 bar, which is good.

      While I'm looking for a similar function, which is called at a new H1 bar - please kindly share your advise.

      Thank you!

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

        Maybe I have found the answer in the document:
        "When a compressed bar is forming, the length len(self) of the strategy will remain unchanged."

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors