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,