diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index b203d6d3b..900dafb33 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -1009,8 +1009,8 @@ This is a common pain-point, which can cause huge differences between backtestin The following lists some common patterns which should be avoided to prevent frustration: -- don't use `shift(-1)`. This uses data from the future, which is not available. -- don't use `.iloc[-1]` or any other absolute position in the dataframe, this will be different between dry-run and backtesting. +- don't use `shift(-1)` or other negative values. This uses data from the future in backtesting, which is not available in dry or live modes. +- don't use `.iloc[-1]` or any other absolute position in the dataframe within `populate_` functions, as this will be different between dry-run and backtesting. Absolute `iloc` indexing is safe to use in callbacks however - see [Strategy Callbacks](strategy-callbacks.md). - don't use `dataframe['volume'].mean()`. This uses the full DataFrame for backtesting, including data from the future. Use `dataframe['volume'].rolling().mean()` instead - don't use `.resample('1h')`. This uses the left border of the interval, so moves data from an hour to the start of the hour. Use `.resample('1h', label='right')` instead.