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/

    Impact of a data feed's boundary time convention (rightedge)

    General Discussion
    3
    4
    621
    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.
    • Z
      z_kvn last edited by z_kvn

      Hello

      I noticed most of the downloaded historical data from various of data sources (Bloomberg, IB_Insync) seem to have a convention of "rightedge=False", i.e. a minute bar as of timestamp "21:23:00" is actually forward looking in the period of 21:23:00-21:23:59 for open/high/low/close. On the other hand, by default backtrader has a convention of "rightedge=True" in resampling, i.e. it is actually backward looking in the period of 21:22:00-21:22:59 for the minute timestamp "21:23:00".

      Understand backtrader's convention makes sense since in actual world you can only look backward as of a timestamp and see what has happened. Just wonder whether this is taken into consideration in design? Specifically, if I have a minute bar data or 30 seconds feed that is using forward looking convention or "rightedge=False", is there proper parameter settings in cerebro to make sure when data is loaded into the system, everything will be converted properly to backward looking/rightedge? Or do I have to manually convert the data feed to backward looking/rightedge convention?

      I've tried multiple settings but looks like manually converting the datafeed's convention is the only option, and I've found multiple related discussions but there seems to be no direct discussion regarding the data feed's "rightedge" convention.

      Related discussions:
      Backtest vs live bars "off-by-1" discrepancy?

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

        There is no provision in place for an automatic conversion. You may try applying a filter and replacing the timestamp.

        • Docs - Filters
        1 Reply Last reply Reply Quote 0
        • Z
          z_kvn last edited by

          Thanks for the response. I will try it.

          Kisko Apeles 1 Reply Last reply Reply Quote 1
          • Kisko Apeles
            Kisko Apeles @z_kvn last edited by

            @z_kvn How did it go?

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