mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
feat: add trading-mode to list-timeframes
some exchanges provide different timeframe configurations depending on the market type
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user