improve trading_mode handling

Ensure trading_mode is set by new-config
handle empty strings to default to spot.

closes #6663
This commit is contained in:
Matthias
2022-04-07 08:45:45 +00:00
parent 299dd84cfe
commit 3188d036a6
2 changed files with 5 additions and 2 deletions

View File

@@ -202,6 +202,8 @@ def ask_user_config() -> Dict[str, Any]:
if not answers:
# Interrupted questionary sessions return an empty dict.
raise OperationalException("User interrupted interactive questions.")
# Ensure default is set for non-futures exchanges
answers['trading_mode'] = answers.get('trading_mode', "spot")
answers['margin_mode'] = (
'isolated'
if answers.get('trading_mode') == 'futures'