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


  • administrators

    Use the link below to go the original post

    Click here to see the full blog post



  • 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)?


  • administrators

    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)



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


  • administrators

    @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 ...



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


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.