From 1299a703e279ad61b99625b601bc72380e344049 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 17 Mar 2022 20:15:51 +0100 Subject: [PATCH] Implement fix for okx futures not having quoteVolume --- freqtrade/exchange/exchange.py | 1 + freqtrade/exchange/okx.py | 3 +++ freqtrade/plugins/pairlist/VolumePairList.py | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 03d29233e..a0b1177ad 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -67,6 +67,7 @@ class Exchange: "ohlcv_partial_candle": True, # Check https://github.com/ccxt/ccxt/issues/10767 for removal of ohlcv_volume_currency "ohlcv_volume_currency": "base", # "base" or "quote" + "tickers_has_quoteVolume": True, "trades_pagination": "time", # Possible are "time" or "id" "trades_pagination_arg": "since", "l2_limit_range": None, diff --git a/freqtrade/exchange/okx.py b/freqtrade/exchange/okx.py index 08c29c7b2..aa4390b31 100644 --- a/freqtrade/exchange/okx.py +++ b/freqtrade/exchange/okx.py @@ -23,6 +23,9 @@ class Okx(Exchange): "mark_ohlcv_timeframe": "4h", "funding_fee_timeframe": "8h", } + _ft_has_futures: Dict = { + "tickers_has_quoteVolume": False, + } _supported_trading_mode_margin_pairs: List[Tuple[TradingMode, MarginMode]] = [ # TradingMode.SPOT always supported and not required in this list diff --git a/freqtrade/plugins/pairlist/VolumePairList.py b/freqtrade/plugins/pairlist/VolumePairList.py index 6adca7369..f18dce735 100644 --- a/freqtrade/plugins/pairlist/VolumePairList.py +++ b/freqtrade/plugins/pairlist/VolumePairList.py @@ -71,7 +71,9 @@ class VolumePairList(IPairList): f'to at least {self._tf_in_sec} and restart the bot.' ) - if not self._use_range and not self._exchange.exchange_has('fetchTickers'): + if (not self._use_range and not ( + self._exchange.exchange_has('fetchTickers') + and self._exchange._ft_has["tickers_has_quoteVolume"])): raise OperationalException( "Exchange does not support dynamic whitelist in this configuration. " "Please edit your config and either remove Volumepairlist, "