Skip to content

Commit

Permalink
[Exchanges] 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 6a74d55 commit 4897630
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def initialize_impl(self):
)

# initialize symbols and timeframes
self.symbols = self.get_client_symbols(active_only=True)
self.symbols = self.exchange_manager.exchange.get_all_available_symbols(active_only=True)
self.time_frames = self.get_client_time_frames()

except (ccxt.ExchangeNotAvailable, ccxt.RequestTimeout) as e:
Expand Down
6 changes: 5 additions & 1 deletion octobot_trading/exchanges/types/rest_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class RestExchange(abstract_exchange.AbstractExchange):
# set True when get_fixed_market_status should adapt amounts for contract size
# (amounts are in not kept as contract size with OctoBot)
ADAPT_MARKET_STATUS_FOR_CONTRACT_SIZE = False
# set True when disabled symbols should still be considered (ex: mexc with its temporary api trading disabled symbols)
INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS = False
REQUIRE_ORDER_FEES_FROM_TRADES = False # set True when get_order is not giving fees on closed orders and fees
# should be fetched using recent trades.
REQUIRE_CLOSED_ORDERS_FROM_RECENT_TRADES = False # set True when get_closed_orders is not supported
Expand Down Expand Up @@ -731,7 +733,9 @@ def get_all_available_symbols(self, active_only=True) -> set[str]:
"""
:return: the list of all symbols supported by the exchange
"""
return self.connector.get_client_symbols(active_only=active_only)
return self.connector.get_client_symbols(
active_only=False if self.INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS else active_only
)

async def get_all_tradable_symbols(self, active_only=True) -> set[str]:
"""
Expand Down

0 comments on commit 4897630

Please sign in to comment.