From 7b138ef3b496b33e4c27790eec42b394f589172e Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 21 Jan 2019 20:03:19 +0100 Subject: [PATCH] Add warning about strategy/backtesting --- docs/bot-optimization.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/bot-optimization.md b/docs/bot-optimization.md index 51e2f0f63..cefcacee6 100644 --- a/docs/bot-optimization.md +++ b/docs/bot-optimization.md @@ -47,6 +47,12 @@ python3 ./freqtrade/main.py --strategy AwesomeStrategy **For the following section we will use the [user_data/strategies/test_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/strategies/test_strategy.py) file as reference.** +!!! Note: Strategies and Backtesting + To avoid problems and unexpected differences between Backtesting and dry/live modes, please be aware + that during backtesting the full time-interval is passed to the `populate_*()` methods at once. + 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. + ### 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.