From bb8ced525a848904f3a16459c1664fb0dd100e14 Mon Sep 17 00:00:00 2001 From: Joe Schr <8218910+TheJoeSchr@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:20:01 +0200 Subject: [PATCH] exchange: re-add hardcoded required candle call count max --- freqtrade/exchange/exchange.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 26f063265..587be8dbb 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -165,7 +165,6 @@ class Exchange: # Assign this directly for easy access self._ohlcv_partial_candle = self._ft_has['ohlcv_partial_candle'] - self._required_candle_call_count_max = self._config.get('exchange', {}).get('required_candle_call_count_max', 5) self._max_trades_candle_limit = self._config.get('exchange', {}).get('trades_candle_limit', 1000) @@ -691,11 +690,11 @@ class Exchange: (candle_count / candle_limit) + (0 if candle_count % candle_limit == 0 else 1)) if self._ft_has['ohlcv_has_history']: - if required_candle_call_count > self._required_candle_call_count_max: + if required_candle_call_count > 5: # Only allow max calls per pair to somewhat limit the impact raise OperationalException( f"This strategy requires {startup_candles} candles to start, " - f"which is more than {self._required_candle_call_count_max} " + f"which is more than 5" f"the amount of candles {self.name} provides for {timeframe}.") elif required_candle_call_count > 1: raise OperationalException( @@ -2053,7 +2052,7 @@ class Exchange: not_all_data = cache and self.required_candle_call_count > 1 if cache and (pair, timeframe, candle_type) in self._klines: candle_limit = self.ohlcv_candle_limit(timeframe, candle_type) - min_date = date_minus_candles(timeframe, candle_limit - self._required_candle_call_count_max).timestamp() + min_date = date_minus_candles(timeframe, candle_limit - 5).timestamp() # Check if 1 call can get us updated candles without hole in the data. if min_date < self._pairs_last_refresh_time.get((pair, timeframe, candle_type), 0): # Cache can be used - do one-off call. @@ -2084,7 +2083,7 @@ class Exchange: not_all_data = cache and self.required_candle_call_count > 1 if cache and (pair, timeframe, candle_type) in self._trades: candle_limit = self.trades_candle_limit(timeframe, candle_type) - min_date = date_minus_candles(timeframe, candle_limit - self._required_candle_call_count_max).timestamp() + min_date = date_minus_candles(timeframe, candle_limit - 5).timestamp() # Check if 1 call can get us updated candles without hole in the data. if min_date < self._pairs_last_refresh_time.get((pair, timeframe, candle_type), 0): # Cache can be used - do one-off call.