fix: validate trading-mode support when downloading data

closes #12458
This commit is contained in:
Matthias
2025-11-02 09:40:15 +01:00
parent baa5b1a58e
commit 3cfa366ec9

View File

@@ -693,6 +693,9 @@ def download_data(
"""
Download data function. Used from both cli and API.
"""
exchange.validate_trading_mode_and_margin_mode(
config.get("trading_mode", TradingMode.SPOT), None, allow_none_margin_mode=True
)
timerange = TimeRange()
if "days" in config and config["days"] is not None:
time_since = (datetime.now() - timedelta(days=config["days"])).strftime("%Y%m%d")