From 754f24c8a684ade59dfccdcfa1e2e1a0aca67fd5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Apr 2026 13:48:54 +0200 Subject: [PATCH] feat: allow skipping of the wallet migration fallback method in case of problems --- build_helpers/schema.json | 4 ++++ freqtrade/config_schema/config_schema.py | 4 ++++ freqtrade/util/migrations/migrate_wallet_history.py | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build_helpers/schema.json b/build_helpers/schema.json index 8bf56b2a1..5d07b4ad1 100644 --- a/build_helpers/schema.json +++ b/build_helpers/schema.json @@ -283,6 +283,10 @@ "month" ] }, + "skip_wallet_history_migration": { + "description": "Disable wallet history migration.", + "type": "boolean" + }, "hyperopt_path": { "description": "Specify additional lookup path for Hyperopt Loss functions.", "type": "string" diff --git a/freqtrade/config_schema/config_schema.py b/freqtrade/config_schema/config_schema.py index fc2c42441..7fc885662 100644 --- a/freqtrade/config_schema/config_schema.py +++ b/freqtrade/config_schema/config_schema.py @@ -236,6 +236,10 @@ CONF_SCHEMA = { "type": "string", "enum": BACKTEST_CACHE_AGE, }, + "skip_wallet_history_migration": { + "description": "Disable wallet history migration.", + "type": "boolean", + }, # Hyperopt "hyperopt_path": { "description": "Specify additional lookup path for Hyperopt Loss functions.", diff --git a/freqtrade/util/migrations/migrate_wallet_history.py b/freqtrade/util/migrations/migrate_wallet_history.py index 30a31b8e7..82af820d3 100644 --- a/freqtrade/util/migrations/migrate_wallet_history.py +++ b/freqtrade/util/migrations/migrate_wallet_history.py @@ -16,7 +16,9 @@ logger = logging.getLogger(__name__) def migrate_wallet_history(config: Config, exchange: Exchange, starting_balance: float): - if not exchange.get_option("ohlcv_has_history", True): + if config.get("skip_wallet_history_migration") or not exchange.get_option( + "ohlcv_has_history", True + ): # we can't fill up wallet history without ohlcv history return if KeyValueStore.get_int_value("wallet_history_migration"):