From dc256684686f41c46527a88cdcc75496bd165612 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Wed, 4 Jan 2023 11:41:06 +0100 Subject: [PATCH] handle data gaps between FreqAI and DP better --- freqtrade/freqai/data_drawer.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index 848fb20eb..d8e08ed2d 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -645,12 +645,20 @@ class FreqaiDataDrawer: + 1 ) except IndexError: + index = -1 + if history_data[pair][tf].iloc[-1]['date'] < df_dp['date'].iloc[0]: + index = 0 + else: + index = -1 logger.warning( - f"Unable to update pair history for {pair}. " - "If this does not resolve itself after 1 additional candle, " - "please report the error to #freqai discord channel" + f"No common dates in historical data and dataprovider for {pair}. " + f"Appending dataprovider to historical data (full? {not bool(index)})" + "but please be aware that there is likely a gap in the historical " + "data.\n" + f"Historical data ends at {history_data[pair][tf].iloc[-1]['date']} " + f"while dataprovider starts at {df_dp['date'].iloc[0]} and" + f"ends at {df_dp['date'].iloc[0]}." ) - return history_data[pair][tf] = pd.concat( [