From aff5372a8f70cf8bb36fce621b77f84f02428bc2 Mon Sep 17 00:00:00 2001 From: Robert Caulk Date: Fri, 29 Sep 2023 13:12:44 +0200 Subject: [PATCH 1/2] chore: protect users against process_only_new_candles=False --- freqtrade/freqai/freqai_interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index 33d23aa73..c0f31df3c 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -138,7 +138,6 @@ class IFreqaiModel(ABC): :param metadata: pair metadata coming from strategy. :param strategy: Strategy to train on """ - self.live = strategy.dp.runmode in (RunMode.DRY_RUN, RunMode.LIVE) self.dd.set_pair_dict_info(metadata) self.data_provider = strategy.dp @@ -394,6 +393,11 @@ class IFreqaiModel(ABC): dk: FreqaiDataKitchen = Data management/analysis tool associated to present pair only """ + if not strategy.process_only_new_candles: + raise OperationalException("You are trying to use a FreqAI strategy with " + "process_only_new_candles = False. This is not supported " + "by FreqAI, and it is therefore aborting.") + # get the model metadata associated with the current pair (_, trained_timestamp) = self.dd.get_pair_dict_info(metadata["pair"]) From 2d56b1bc8c5011614a9acd6fddf1e752759eb338 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 30 Sep 2023 08:23:21 +0200 Subject: [PATCH 2/2] Fix whitespace --- freqtrade/freqai/freqai_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index c0f31df3c..574bec348 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -397,7 +397,7 @@ class IFreqaiModel(ABC): raise OperationalException("You are trying to use a FreqAI strategy with " "process_only_new_candles = False. This is not supported " "by FreqAI, and it is therefore aborting.") - + # get the model metadata associated with the current pair (_, trained_timestamp) = self.dd.get_pair_dict_info(metadata["pair"])