Clearly warn about using future data during strategy development
This commit is contained in:
parent
2463f0257e
commit
8d8b4a69b7
@ -53,6 +53,12 @@ file as reference.**
|
|||||||
It is therefore best to use vectorized operations (across the whole dataframe, not loops) and
|
It is therefore best to use vectorized operations (across the whole dataframe, not loops) and
|
||||||
avoid index referencing (`df.iloc[-1]`), but instead use `df.shift()` to get to the previous candle.
|
avoid index referencing (`df.iloc[-1]`), but instead use `df.shift()` to get to the previous candle.
|
||||||
|
|
||||||
|
!!! Warning Using future data
|
||||||
|
Since backtesting passes the full time interval to the `populate_*()` methods, the strategy author
|
||||||
|
needs to take care to avoid having the strategy utilize data from the future.
|
||||||
|
Samples for usage of future data are `dataframe.shift(-1)`, `dataframe.resample("1h")` (this uses the left border of the interval, so moves data from an hour to the start of the hour).
|
||||||
|
They all use data which is not available during regular operations, so these strategies will perform well during backtesting, but will fail / perform badly dry-run tests.
|
||||||
|
|
||||||
### Customize Indicators
|
### Customize Indicators
|
||||||
|
|
||||||
Buy and sell strategies need indicators. You can add more indicators by extending the list contained in the method `populate_indicators()` from your strategy file.
|
Buy and sell strategies need indicators. You can add more indicators by extending the list contained in the method `populate_indicators()` from your strategy file.
|
||||||
|
Loading…
Reference in New Issue
Block a user