Skip to content

Commit

Permalink
[MEXC] add INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 20, 2025
1 parent e9fe53f commit 162bccf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Trading/Exchange/mexc/mexc_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 162bccf

Please sign in to comment.