feat: support filtering exchanges by trade mode

This commit is contained in:
Matthias
2025-08-03 18:25:51 +02:00
parent cffee80b0e
commit a05cb8f1c5
2 changed files with 8 additions and 1 deletions

View File

@@ -96,7 +96,7 @@ ARGS_LIST_HYPEROPTS = ["hyperopt_path", "print_one_column"]
ARGS_BACKTEST_SHOW = ["exportfilename", "backtest_show_pair_list", "backtest_breakdown"] ARGS_BACKTEST_SHOW = ["exportfilename", "backtest_show_pair_list", "backtest_breakdown"]
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all"] ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all", "trading_mode"]
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"] ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"]

View File

@@ -46,7 +46,14 @@ def start_list_exchanges(args: dict[str, Any]) -> None:
table.add_column("Markets") table.add_column("Markets")
table.add_column("Reason") table.add_column("Reason")
trading_mode = args.get("trading_mode", None)
for exchange in available_exchanges: for exchange in available_exchanges:
if trading_mode and not any(
a["trading_mode"] == trading_mode for a in exchange["trade_modes"]
):
# If trading_mode is specified, only show exchanges that support it
continue
name = Text(exchange["name"]) name = Text(exchange["name"])
if exchange["supported"]: if exchange["supported"]:
name.append(" (Supported)", style="italic") name.append(" (Supported)", style="italic")