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/

    datetime of a candle, open or close time?

    General Code/Help
    2
    6
    1025
    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.
    • bb2
      bb2 last edited by

      Hello,

      For a given CSV data, does backtrader assume that the datetime is the opening time of the candle? Is there any way to change that behaviour?

      Thank you in advance

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

        You probably need to enlighten us, with what you want. A candle has 4 points (OHLC) but a single timestamp. That doesn't have to do with days, minutes or the timeframe. It's a definition.

        You are probably looking at using smaller timeframes.

        bb2 1 Reply Last reply Reply Quote 0
        • bb2
          bb2 @backtrader last edited by

          @backtrader timestamp of the arrival time or timestamp of the closing time of the candle?

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

            @backtrader in accordance with that, how does resampledata handle timestamps?

            Let's assume I have 1 minute data with opening times starting from 18:00 until but not including 19:30, e.g.:

            18:00 o h l c
            18:01 o h l c
            ...
            19:28 o h l c
            19:29 o h l c
            

            If I were to resample it to 30 minutes, what would be the timestamps of the resampled data?

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

              I think what I am searching for is the rightedge attribute of resampledata. I will give it a quick shot.

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

                figured it out. set boundoff=1 as arg of replaydata

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