Skip to content

Commit ea52deb

Browse files
authored
Merge pull request freqtrade#12648 from hippocritical/develop
adjusted the error message of "more than 5 queries needed for exchange"
2 parents 46ee092 + 7b33242 commit ea52deb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

freqtrade/exchange/exchange.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,19 +879,20 @@ def validate_required_startup_candles(self, startup_candles: int, timeframe: str
879879
# Only allow 5 calls per pair to somewhat limit the impact
880880
raise ConfigurationError(
881881
f"This strategy requires {startup_candles} candles to start, "
882-
"which is more than 5x "
882+
f"which is more than 5x ({candle_limit * 5 - 1} candles) "
883883
f"the amount of candles {self.name} provides for {timeframe}."
884884
)
885885
elif required_candle_call_count > 1:
886886
raise ConfigurationError(
887-
f"This strategy requires {startup_candles} candles to start, which is more than "
887+
f"This strategy requires {startup_candles} candles to start, "
888+
f"which is more than ({candle_limit - 1} candles) "
888889
f"the amount of candles {self.name} provides for {timeframe}."
889890
)
890891
if required_candle_call_count > 1:
891892
logger.warning(
892893
f"Using {required_candle_call_count} calls to get OHLCV. "
893894
f"This can result in slower operations for the bot. Please check "
894-
f"if you really need {startup_candles} candles for your strategy"
895+
f"if you really need {startup_candles} candles for your strategy."
895896
)
896897
return required_candle_call_count
897898

tests/exchange/test_exchange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def test_validate_required_startup_candles(default_conf, mocker, caplog):
10121012
ex._ft_has["ohlcv_has_history"] = False
10131013
with pytest.raises(
10141014
OperationalException,
1015-
match=r"This strategy requires 2500.*, " r"which is more than the amount.*",
1015+
match=r"This strategy requires 2500.*, " r"which is more than .* the amount",
10161016
):
10171017
ex.validate_required_startup_candles(2500, "5m")
10181018

0 commit comments

Comments
 (0)