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/

    Trade markers misaligned with price due to gaps in data?

    General Discussion
    2
    4
    1058
    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.
    • A
      aaggmm last edited by

      BackTrader,
      In multi-data back-testing, when one data has a gap, the markers for trades after this gap appear to be misaligned with the price data, by the number of bars during the gap. (The actual order and trade records are correct, so this is only a plotting issue.) It appears only happen with multi-data. Please see example graph below. Any advise? Thanks!

      0_1523951874248_Figure_0.png

      1 Reply Last reply Reply Quote 0
      • A
        aaggmm last edited by

        In the chart above, before the data gap, trades are correctly marked on the bar after the signal bar (Crossover=1/-1), but after the gap, it is marked on the second bar after. Anyone who can help? Thanks in advance!

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

          Plotting was only meant as a visual aid and not as exact representation. The limitations on the alignment of axis which are inherent to matplotlib (or maybe to the lack of understanding of the many underlying complexities lurking in such a complex package) make it impossible to achieve a perfect alignment.

          1 Reply Last reply Reply Quote 0
          • A
            aaggmm last edited by

            Thanks, hope there is way to fix it in the future.

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