For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Timeframe Question

  • I importet a 1 minute datafeed in my project. For this reason I derived a new class from GenericCSVData. In order to cope with datetime I changed the "dtformat" to 1 (as the CSV contains UNIX timestamp).

    Now after I run the project with an example strategy used in the "quickstart" documentation. I end up with a 0,2% profit.

    However, I read in here in the forum that I should add "timeframe" and "compression" to the GenericCSVData params. So I did set "timeframe" to "bt.TimeFrame.Minutes" and "compression" to "1".

    Running the code again now yields a completely different result. Instead of a 0,2% profit it ends up with a 65% loss. So what exactly does "timeframe" and "compression" do here? Both times all datapoints were parsed. Seemingly it didn't change anything. However, the result is completely different.

    If you are wondering I used the buy after 3 consecutive higher closes strategy of the quickstart guide for testing purposes.

  • @Pave said in Timeframe Question:

    So what exactly does "timeframe" and "compression" do here?

    These parameters let bt know the length of the single price bar. More details are in Docs - Data feed.

Log in to reply