File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1818from freqtrade .enums import (
1919 NON_UTIL_MODES ,
2020 TRADE_MODES ,
21+ CandleType ,
22+ MarginMode ,
2123 RunMode ,
24+ TradingMode ,
2225)
2326from freqtrade .exceptions import OperationalException
2427from freqtrade .loggers import setup_logging
@@ -406,6 +409,14 @@ def _process_data_options(self, config: Config) -> None:
406409 self ._args_to_config (
407410 config , argname = "trading_mode" , logstring = "Detected --trading-mode: {}"
408411 )
412+ # TODO: The following 3 lines (candle_type_def, trading_mode, margin_mode) are actually
413+ # set in the exchange class. They're however necessary as fallback to avoid
414+ # random errors in commands that don't initialize an exchange.
415+ config ["candle_type_def" ] = CandleType .get_default (
416+ config .get ("trading_mode" , "spot" ) or "spot"
417+ )
418+ config ["trading_mode" ] = TradingMode (config .get ("trading_mode" , "spot" ) or "spot" )
419+ config ["margin_mode" ] = MarginMode (config .get ("margin_mode" , "" ) or "" )
409420 self ._args_to_config (
410421 config , argname = "candle_types" , logstring = "Detected --candle-types: {}"
411422 )
You can’t perform that action at this time.
0 commit comments