From 88cc24c5b96fed30cad1d299eeee748253f2614c Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 12 Sep 2025 06:55:15 +0200 Subject: [PATCH] chore: fix odd code comment --- freqtrade/strategy/strategy_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/strategy/strategy_helper.py b/freqtrade/strategy/strategy_helper.py index 4a90d6661..db2ba88fa 100644 --- a/freqtrade/strategy/strategy_helper.py +++ b/freqtrade/strategy/strategy_helper.py @@ -93,9 +93,10 @@ def merge_informative_pair( how="left", ) - # If date_merge of the informative dataframe candle that is above of first date of dataframe, then first raws of - # dataframe are filled with Nans. The code below is to fix it and fulfill first raws with an appropriate values. if len(dataframe) > 1 and len(informative) > 0 and pd.isnull(dataframe.iloc[0][date_merge]): + # If the start dates of the dataframes are not aligned, the first rows will be NaN + # We can fill these with the last available informative candle before the start date + # while still avoiding lookahead bias - as only past data is used. first_valid_idx = dataframe[date_merge].first_valid_index() first_valid_date_merge = dataframe.loc[first_valid_idx, date_merge] matching_informative_raws = informative[