Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MEXC] add INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS #1422

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading