Merge pull request #12648 from hippocritical/develop

adjusted the error message of "more than 5 queries needed for exchange"
This commit is contained in:
Matthias
2025-12-23 13:22:58 +01:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -879,19 +879,20 @@ class Exchange:
# Only allow 5 calls per pair to somewhat limit the impact # Only allow 5 calls per pair to somewhat limit the impact
raise ConfigurationError( raise ConfigurationError(
f"This strategy requires {startup_candles} candles to start, " f"This strategy requires {startup_candles} candles to start, "
"which is more than 5x " f"which is more than 5x ({candle_limit * 5 - 1} candles) "
f"the amount of candles {self.name} provides for {timeframe}." f"the amount of candles {self.name} provides for {timeframe}."
) )
elif required_candle_call_count > 1: elif required_candle_call_count > 1:
raise ConfigurationError( 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}." f"the amount of candles {self.name} provides for {timeframe}."
) )
if required_candle_call_count > 1: if required_candle_call_count > 1:
logger.warning( logger.warning(
f"Using {required_candle_call_count} calls to get OHLCV. " f"Using {required_candle_call_count} calls to get OHLCV. "
f"This can result in slower operations for the bot. Please check " 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 return required_candle_call_count

View File

@@ -1012,7 +1012,7 @@ def test_validate_required_startup_candles(default_conf, mocker, caplog):
ex._ft_has["ohlcv_has_history"] = False ex._ft_has["ohlcv_has_history"] = False
with pytest.raises( with pytest.raises(
OperationalException, 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") ex.validate_required_startup_candles(2500, "5m")