From 3cfa366ec9c676abf9da0b3c40d8f3eb43d1e2d2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 2 Nov 2025 09:40:15 +0100 Subject: [PATCH] fix: validate trading-mode support when downloading data closes #12458 --- freqtrade/data/history/history_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 3b93d2bdc..40c989733 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -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")