Warm up period #321
Replies: 4 comments 9 replies
-
We do skip the first couple bars, precisely to avoid testing on NaN indicators: backtesting.py/backtesting/backtesting.py Lines 1144 to 1147 in 0b2325f By backtest range, do you mean stats['End'] and stats['Duration'] ?
|
Beta Was this translation helpful? Give feedback.
-
the warm up period should be excluded from |
Beta Was this translation helpful? Give feedback.
-
We must have optional parameters date_begin and date_end to run the backtesting. Now I'm trying to implement this because I badly need it as well as the trading orders over the options prices provided with a custom function from a database. I see that statistics use first and last value for the closing price from the prices dataframe to calculate the duration of the trades and the corresponding Buy & Hold Return, etc. This way if you have let say using Wave C for the John Carter's Squeeze system then the backtesting will skip first ~400 bars for the trading but they will be included for the Buy & Hold Return which is wrong. We must define the starting date for everything, otherwise we will never create a strategy close enough to the wrongly calculated Buy & Hold Return with 2 years (in my case) of advance calculation. |
Beta Was this translation helpful? Give feedback.
-
I didn't see this issue but I mention my observation just to accent how important is to have clear start and end for everything to avoid such mysteries how good is just to buy and hold. |
Beta Was this translation helpful? Give feedback.
-
hi, is it possible to add a warm up period when calling run()? if my indicator needs 500 bars to start generating an output, i don't want these bars to be included in the backtest range.
Beta Was this translation helpful? Give feedback.
All reactions