From 162bccf37312d2e2b101f676edb00199a482a951 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Mon, 20 Jan 2025 17:39:16 +0100 Subject: [PATCH] [MEXC] add INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS --- Trading/Exchange/mexc/mexc_exchange.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Trading/Exchange/mexc/mexc_exchange.py b/Trading/Exchange/mexc/mexc_exchange.py index 390f12687..21392e14c 100644 --- a/Trading/Exchange/mexc/mexc_exchange.py +++ b/Trading/Exchange/mexc/mexc_exchange.py @@ -32,6 +32,9 @@ class MEXC(exchanges.RestExchange): FIX_MARKET_STATUS = True REMOVE_MARKET_STATUS_PRICE_LIMITS = True + # set True when disabled symbols should still be considered (ex: mexc with its temporary api trading disabled symbols) + # => avoid skipping untradable symbols + INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS = True EXPECT_POSSIBLE_ORDER_NOT_FOUND_DURING_ORDER_CREATION = True # set True when get_order() can return None # (order not found) when orders are instantly filled on exchange and are not fully processed on the exchange side. @@ -108,13 +111,10 @@ async def _mexc_handled_symbols_filter(self, symbol): try: yield except (ccxt.BadSymbol, ccxt.BadRequest) as err: - if CACHED_MEXC_API_HANDLED_SYMBOLS.should_be_updated(): - await CACHED_MEXC_API_HANDLED_SYMBOLS.update(self) - if symbol not in CACHED_MEXC_API_HANDLED_SYMBOLS.symbols: + if "symbol not support api" in str(err): raise octobot_trading.errors.UntradableSymbolError( f"{self.get_name()} error: {symbol} trading pair is not available to the API at the moment, " - f"{symbol} is under maintenance ({err}). " - f"API available trading pairs are {CACHED_MEXC_API_HANDLED_SYMBOLS.symbols}" + f"{symbol} is under maintenance ({err})." ) raise err