Backtrader Community

    • 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/

    Benchmarking

    Blog
    3
    6
    2123
    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
      backtrader administrators last edited by

      Use the link below to go the original post

      Click here to see the full blog post

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

        I was playing with benchmark observer a little bit and noticed the following - benchmark curve is shown for the full set of data from very first bar. In cases when the strategy starts trading later due to certain period required for indicator calculations, the comparison with the benchmark fails. Especially if one uses long indicator periods like a year.

        Could you add an option to start benchmarking at the time when strategy actually starts (after min period gone)?

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        1 Reply Last reply Reply Quote 0
        • B
          backtrader administrators last edited by

          This is a very good observation for this particular observer and therefore a candidate for inclusion.

          Although it would seem trivial to simply override prenext in the aforementioned observer, it is unfortunately not that simply given the dependencies the observer has on the TimeReturn analyzer which is the one actually doing the calculations (the TimeReturn and Benchmark observers do simply observe and return the values from this analyzer)

          1 Reply Last reply Reply Quote 1
          • A
            Alexan last edited by

            When trying to add an analyzer with a _name parameter, it says: init() got an unexpected keyword argument '_name'

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

              @alexan said in Benchmarking:

              When trying to add an analyzer with a _name parameter, it says: init() got an unexpected keyword argument '_name'

              It all may be bright and sunny where you are, but we cannot know it because we are not where you are.

              The same happens with ... trying to add an analyzer .... You may be pretty sure you are doing what you say you are doing, but we cannot see it, we cannot know it and we cannot therefore help.

              On the other hand, if you post a code sample (and associated output) that does things by the book and break the platform ...

              1 Reply Last reply Reply Quote 1
              • A
                Alexan last edited by

                Thanks for the response. I apologize for my mistake - I had added a _name to my observers as well, which seem to not accept that parameter.

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