fix: update datadir when exchange is changed for an endpoint

This commit is contained in:
Matthias
2025-03-03 19:28:02 +01:00
parent bccbac9f23
commit ef239b8d0c

View File

@@ -110,13 +110,17 @@ def handleExchangePayload(payload: ExchangeModePayloadMixin, config_loc: Config)
Handle exchange and trading mode payload.
Updates the configuration with the payload values.
"""
from freqtrade.configuration.directory_operations import create_datadir
if payload.exchange:
config_loc["exchange"]["name"] = payload.exchange
config_loc.update({"datadir": create_datadir(config_loc, None)})
if payload.trading_mode:
config_loc["trading_mode"] = payload.trading_mode
config_loc["candle_type_def"] = CandleType.get_default(
config_loc.get("trading_mode", "spot") or "spot"
)
if payload.margin_mode:
config_loc["margin_mode"] = payload.margin_mode