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/

    Expected behavior for Resample with gaps?

    General Code/Help
    2
    4
    398
    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.
    • Jacob
      Jacob last edited by

      My data is of 1-min timeframe and I'm resampling it to 5-min.
      but sometimes the 1-min data have gaps (let's say up to 10 min gaps)

      what is backtrader expected behavior for resampling if gap is <5-min?
      and what if gap>5-min?

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

        Easy: no data no bar. Why should it be otherwise?

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

          Then it is quite a surprise.
          lets say only 1 min is missing out of 5 needed (most likely cause no trade was actually made in that time, which happens very frequently)

          I don't understand why a resample won't happen with 4 out of the 5 minute?
          for me, it make more sense to work with the missing values (first price available is open, last for close, min-max for high and low, and sum for volume) instead of disregarding them completely

          for the case when we are missing the whole 5 min, I agree 'no data no bar'

          I would have expected that if i have at least one bar available I can resample to higher time frame

          say we have the following data:
          min |

          the smaller the timeframe the higher the chance of gaps in the data

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

            @jacob said in Expected behavior for Resample with gaps?:

            Then it is quite a surprise.

            You should probably read your own question and re-read the answer.

            @jacob said in Expected behavior for Resample with gaps?:

            I don't understand why a resample won't happen with 4 out of the 5 minute?

            You understand it wrong. "No data no bar" means that. In this case there is data.

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