mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-18 22:01:15 +00:00
fix: update datadir when exchange is changed for an endpoint
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user