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

@@ -433,8 +433,9 @@ class Configuration:
logstring='Detected --new-pairs-days: {}')
self._args_to_config(config, argname='trading_mode',
logstring='Detected --trading-mode: {}')
config['candle_type_def'] = CandleType.get_default(config.get('trading_mode', 'spot'))
config['trading_mode'] = TradingMode(config.get('trading_mode', 'spot'))
config['candle_type_def'] = CandleType.get_default(
config.get('trading_mode', 'spot') or 'spot')
config['trading_mode'] = TradingMode(config.get('trading_mode', 'spot') or 'spot')
self._args_to_config(config, argname='candle_types',
logstring='Detected --candle-types: {}')