feat: add trading-mode to list-timeframes

some exchanges provide different timeframe configurations depending on the market type
This commit is contained in:
Matthias
2025-11-15 13:11:10 +01:00
parent 705849db3d
commit ef86b4113d
2 changed files with 10 additions and 2 deletions

View File

@@ -104,7 +104,7 @@ ARGS_BACKTEST_SHOW = [
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all", "trading_mode", "dex_exchanges"]
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"]
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column", "trading_mode"]
ARGS_LIST_PAIRS = [
"exchange",

View File

@@ -430,7 +430,15 @@ class Exchange:
@property
def timeframes(self) -> list[str]:
return list((self._api.timeframes or {}).keys())
market_type = (
"spot"
if self.trading_mode != TradingMode.FUTURES
else self._ft_has["ccxt_futures_name"]
)
timeframes = self._api.options.get("timeframes", {}).get(market_type)
if timeframes is None:
timeframes = self._api.timeframes
return list((timeframes or {}).keys())
@property
def markets(self) -> dict[str, Any]: