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/

    Why do analyzers seem to start calculating on data feeds' start date instead of first order date?

    General Code/Help
    2
    2
    153
    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.
    • Laurentvw
      Laurentvw last edited by

      Suppose I have 2 data feeds, one starting in 1990, another starting in 2000.

      We're waiting for a date were both feeds are available. In 2000, a first order is then being executed inside the strategy.

      When checking the backtesting results, and more specifically the analyzers, I would normally like to see the performance for the strategy to be calculated starting from the date when the first order was executed.

      Unfortunately this does not seem to be the case, from what I can see with the AnnualReturn & SharpeRatio analyzers, the performance seems to be calculated starting from the earliest data feeds' date, so 1990 in this case. This changes the results of the metrics dramatically.

      Could someone shed some light on why this is the default behavior? In my opinion, it would make more sense if the calculations of those analyzers reflected the actual trading timeframe.

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

        I have the opposite result. I have multiple feeds, about ~100. My annual return gets calculated from 2016, but most of my data starts in 2007.

        ===============================================================================
        AnnualReturn:
          - 2016: 0.17989527927894033
          - 2017: 0.2342377414639476
          - 2018: -0.04878029921676286
          - 2019: 0.6714767320608188
          - 2020: 0.13523159391989115
        

        I would like to see a full list of annual returns from 2007.

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