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/

    Multiple Timeframes and data alignment

    General Code/Help
    1
    2
    455
    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.
    • B
      b.steer last edited by

      Hi,

      When using multiple Timeframes, the documentation mentiones that

      The datas must be properly date-time aligned for the platform to make any sense out of them

      For the convenience of future use I'm resampling data files (from here) to daily, weekly and monthly data files. I.e. each bar of the resampled data file will represent a day, week or month.

      Days and months will naturally align, weeks and months will not. What is the meaning of "properly date-time aligned"?

      The data that I'm using has 6 trading days per week. Below are some snippets of resampled weekly and monthly data. Will this be fine as far as backtrader is concerned?

      Weekly:

      20120102 020000, 1.29324, 1.30763, 1.26968, 1.27189, 0.0
      20120108 170000, 1.26946, 1.28776, 1.26255, 1.26803, 0.0
      20120115 170000, 1.26359, 1.29855, 1.26253, 1.29301, 0.0
      20120122 170000, 1.28804, 1.32333, 1.28754, 1.32192, 0.0
      20120129 170000, 1.32268, 1.32271, 1.30253, 1.31564, 0.0
      20120205 170000, 1.3118, 1.33203, 1.30272, 1.3196, 0.0
      20120212 170000, 1.32088, 1.32835, 1.29736, 1.31392, 0.0
      20120219 170000, 1.31806, 1.34856, 1.31727, 1.34465, 0.0
      20120226 170000, 1.34634, 1.34848, 1.31864, 1.31972, 0.0
      20120304 170000, 1.31913, 1.32904, 1.30959, 1.31227, 0.0
      20120311 170000, 1.3104, 1.31906, 1.30033, 1.31741, 0.0
      20120318 170000, 1.31756, 1.32925, 1.31333, 1.32691, 0.0
      20120325 170000, 1.32708, 1.33846, 1.31913, 1.33436, 0.0
      20120401 170000, 1.33602, 1.33796, 1.30345, 1.30956, 0.0
      20120408 170000, 1.31019, 1.3212, 1.30327, 1.3077, 0.0
      20120415 170000, 1.30661, 1.32266, 1.2994, 1.32189, 0.0
      20120422 170000, 1.31828, 1.32695, 1.3104, 1.32535, 0.0
      20120429 170000, 1.32367, 1.32829, 1.30797, 1.30835, 0.0
      20120506 170000, 1.3013, 1.30648, 1.29043, 1.29161, 0.0
      

      Monthly:

      20120102 020000, 1.29324, 1.32333, 1.26253, 1.30661, 0.0
      20120201 000000, 1.3066, 1.34856, 1.29736, 1.33463, 0.0
      20120301 000000, 1.33464, 1.33846, 1.30033, 1.33436, 0.0
      20120401 170000, 1.33602, 1.33796, 1.2994, 1.32428, 0.0
      
      1 Reply Last reply Reply Quote 0
      • B
        b.steer last edited by

        Oh, never mind. This is a non-isue so long as all Timeframes align to the fastest one.

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