From 5f907d421906f9da7bbb29cbc370ddd88ebe4a32 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 10 May 2025 11:43:52 +0200 Subject: [PATCH] chore: move candletype check to can_use_websocket. --- freqtrade/exchange/exchange.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 88cf9be64..de6bfec80 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2449,7 +2449,11 @@ class Exchange: Check if we can use websocket for this pair. Acts as typeguard for exchangeWs """ - if self._has_watch_ohlcv and exchange_ws: + if ( + self._has_watch_ohlcv + and exchange_ws + and candle_type in (CandleType.SPOT, CandleType.FUTURES) + ): return True return False @@ -2462,7 +2466,7 @@ class Exchange: cache: bool, ) -> Coroutine[Any, Any, OHLCVResponse]: not_all_data = cache and self.required_candle_call_count > 1 - if cache and candle_type in (CandleType.SPOT, CandleType.FUTURES): + if cache: if self._can_use_websocket(self._exchange_ws, pair, timeframe, candle_type): # Subscribe to websocket self._exchange_ws.schedule_ohlcv(pair, timeframe, candle_type)