From 60db1b1c0c11eab773cb6525d838ad2611e038eb Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Wed, 2 Feb 2022 01:08:55 -0600 Subject: [PATCH] margin_mode is empty string for spot new configs --- freqtrade/commands/build_config_commands.py | 2 +- freqtrade/templates/base_config.json.j2 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/commands/build_config_commands.py b/freqtrade/commands/build_config_commands.py index 499597f32..76779b64a 100644 --- a/freqtrade/commands/build_config_commands.py +++ b/freqtrade/commands/build_config_commands.py @@ -207,7 +207,7 @@ def ask_user_config() -> Dict[str, Any]: # Interrupted questionary sessions return an empty dict. raise OperationalException("User interrupted interactive questions.") answers["margin_mode"] = ( - '\n "margin_mode": "isolated",' + 'isolated' if answers.get("trading_mode") == 'futures' else '' ) diff --git a/freqtrade/templates/base_config.json.j2 b/freqtrade/templates/base_config.json.j2 index 6e72442c8..60f4b4fd7 100644 --- a/freqtrade/templates/base_config.json.j2 +++ b/freqtrade/templates/base_config.json.j2 @@ -13,7 +13,8 @@ "fiat_display_currency": "{{ fiat_display_currency }}",{{ ('\n "timeframe": "' + timeframe + '",') if timeframe else '' }} "dry_run": {{ dry_run | lower }}, "cancel_open_orders_on_exit": false, - "trading_mode": "{{ trading_mode }}",{{ margin_mode }} + "trading_mode": "{{ trading_mode }}", + "margin_mode": "{{ margin_mode }}", "unfilledtimeout": { "buy": 10, "sell": 10,