diff --git a/docs/freqai-running.md b/docs/freqai-running.md index bb84bd533..42c56c06d 100644 --- a/docs/freqai-running.md +++ b/docs/freqai-running.md @@ -67,6 +67,12 @@ Backtesting mode requires [downloading the necessary data](#downloading-data-to- *want* to retrain a new model with the same config file, you should simply change the `identifier`. This way, you can return to using any model you wish by simply specifying the `identifier`. +!!! Note + Backtesting calls the `set_freqai_targets()` function for every window defined in `backtest_period_days` parameter + to better simulate the dry/run live behavior, but it's analyzes the whole time-range at once in `feature_engineering_*()` for performance reasons. + Because of this, strategy authors need to make sure that strategies do not look-ahead into the future at `feature_engineering_*()` functions. + Strategy authors should carefully read the [Common Mistakes](strategy-customization.md#common-mistakes-when-developing-strategies) + --- ### Saving prediction data diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index a0f29a301..c4e87176c 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -313,14 +313,8 @@ class IFreqaiModel(ABC): dk.append_predictions(append_df) else: if populate_indicators: - tr_from_main_df = (f'{dataframe["date"].min().strftime("%Y%m%d")}' - f'-{dataframe["date"].max().strftime("%Y%m%d")}') - timerange = TimeRange.parse_timerange(tr_from_main_df) - self.dd.load_all_pair_histories(timerange, self.dk) - corr_df, base_df = self.dd.get_base_and_corr_dataframes(timerange, pair, dk) dataframe = self.dk.use_strategy_to_populate_indicators( - strategy, prediction_dataframe=dataframe, pair=metadata["pair"], - corr_dataframes=corr_df, base_dataframes=base_df + strategy, prediction_dataframe=dataframe, pair=metadata["pair"] ) populate_indicators = False