diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 54d2bde51..1d3bd86d6 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -365,6 +365,7 @@ class Exchange: self.validate_pricing(config["exit_pricing"]) self.validate_pricing(config["entry_pricing"]) self.validate_orderflow(config["exchange"]) + self.validate_demo_trading(config["exchange"]) self.validate_freqai(config) self._set_startup_candle_count(config) @@ -870,6 +871,15 @@ class Exchange: "fetching historic OHLCV data, otherwise freqAI will not work." ) + def validate_demo_trading(self, exchange_conf: dict) -> None: + """Validate demo trading configuration + Prevents accidental configuration with wrong expectations. + """ + if exchange_conf.get("demo_trading", False) and not self.get_option( + "supports_demo_trading" + ): + raise ConfigurationError(f"Demo trading is not supported for {self.name}.") + def validate_required_startup_candles(self, startup_candles: int, timeframe: str) -> int: """ Checks if required startup_candles is more than ohlcv_candle_limit().