Skip to content

Commit a80f3ae

Browse files
committed
fix: re-add candle_type_def to configuration
Temporary fix for now ... closes freqtrade#12239
1 parent ecd66f8 commit a80f3ae

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

freqtrade/configuration/configuration.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
from freqtrade.enums import (
1919
NON_UTIL_MODES,
2020
TRADE_MODES,
21+
CandleType,
22+
MarginMode,
2123
RunMode,
24+
TradingMode,
2225
)
2326
from freqtrade.exceptions import OperationalException
2427
from 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
)

0 commit comments

Comments
 (0)