From 335e632bbc60852fb86ef82934d40d21531abeae Mon Sep 17 00:00:00 2001 From: hippocritical Date: Mon, 22 Dec 2025 12:45:31 +0100 Subject: [PATCH 1/4] adjusted the error message of "more than 5 queries needed for exchange" to be more verbose to the user. Now they don't have to guess what the limit actually is to then work towards, helping to better understand the error message. --- freqtrade/exchange/exchange.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 9d6807fa2..142d94440 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -880,7 +880,8 @@ class Exchange: raise ConfigurationError( f"This strategy requires {startup_candles} candles to start, " "which is more than 5x " - f"the amount of candles {self.name} provides for {timeframe}." + f"the amount of candles {self.name} provides for {timeframe}" + f"at a startup_candle_count limit of {candle_limit * 5 - 1}." ) elif required_candle_call_count > 1: raise ConfigurationError( From 0019867da80e7422e9eddb0586b9dd39788a4db9 Mon Sep 17 00:00:00 2001 From: hippocritical Date: Mon, 22 Dec 2025 12:53:01 +0100 Subject: [PATCH 2/4] didn't make a space in the end ... you can book that under typo ... added a . at the end of another warning since all other messages do have the same structure. --- freqtrade/exchange/exchange.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 142d94440..266555806 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -880,7 +880,7 @@ class Exchange: raise ConfigurationError( f"This strategy requires {startup_candles} candles to start, " "which is more than 5x " - f"the amount of candles {self.name} provides for {timeframe}" + f"the amount of candles {self.name} provides for {timeframe} " f"at a startup_candle_count limit of {candle_limit * 5 - 1}." ) elif required_candle_call_count > 1: @@ -892,7 +892,7 @@ class Exchange: logger.warning( f"Using {required_candle_call_count} calls to get OHLCV. " f"This can result in slower operations for the bot. Please check " - f"if you really need {startup_candles} candles for your strategy" + f"if you really need {startup_candles} candles for your strategy." ) return required_candle_call_count From f546146d40e8de39342e647b329aad636b514375 Mon Sep 17 00:00:00 2001 From: hippocritical Date: Tue, 23 Dec 2025 00:44:45 +0100 Subject: [PATCH 3/4] changed the wording in if required_candle_call_count > 5: as per matthias suggestion. adjusted the elif part too, since this would have to be worded similarly. If a native speaker thinks there is a better wording, be our guest. --- freqtrade/exchange/exchange.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 266555806..3085e9ac9 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -879,13 +879,13 @@ class Exchange: # Only allow 5 calls per pair to somewhat limit the impact raise ConfigurationError( f"This strategy requires {startup_candles} candles to start, " - "which is more than 5x " - f"the amount of candles {self.name} provides for {timeframe} " - f"at a startup_candle_count limit of {candle_limit * 5 - 1}." + f"which is more than 5x ({candle_limit * 5 - 1} candles) " + f"the amount of candles {self.name} provides for {timeframe}." ) elif required_candle_call_count > 1: raise ConfigurationError( - f"This strategy requires {startup_candles} candles to start, which is more than " + f"This strategy requires {startup_candles} candles to start, " + f"which is more than ({candle_limit - 1} candles) " f"the amount of candles {self.name} provides for {timeframe}." ) if required_candle_call_count > 1: From 7b33242aa0d88ddcf068f9d09db0bb3d45d1fc9c Mon Sep 17 00:00:00 2001 From: hippocritical Date: Tue, 23 Dec 2025 10:57:47 +0100 Subject: [PATCH 4/4] fixed tests according to failed tests on github --- tests/exchange/test_exchange.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 5772a1c4a..94428cbbf 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -1012,7 +1012,7 @@ def test_validate_required_startup_candles(default_conf, mocker, caplog): ex._ft_has["ohlcv_has_history"] = False with pytest.raises( OperationalException, - match=r"This strategy requires 2500.*, " r"which is more than the amount.*", + match=r"This strategy requires 2500.*, " r"which is more than .* the amount", ): ex.validate_required_startup_candles(2500, "5m")