From 2738c3784559f30d7a19a85ff205cab883f11225 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Feb 2023 20:37:13 +0100 Subject: [PATCH] Test stoploss validation ... --- freqtrade/exchange/exchange.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 253df8607..fda775547 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -606,6 +606,16 @@ class Exchange: raise OperationalException( f'On exchange stoploss is not supported for {self.name}.' ) + if self.trading_mode == TradingMode.FUTURES: + price_mapping = self._ft_has.get('stop_price_type_value_mapping', {}).keys() + if ( + order_types.get("stoploss_on_exchange", False) is True + and 'stoploss_price_type' in order_types + and order_types['stoploss_price_type'] not in price_mapping + ): + raise OperationalException( + f'On exchange stoploss price type is not supported for {self.name}.' + ) def validate_pricing(self, pricing: Dict) -> None: if pricing.get('use_order_book', False) and not self.exchange_has('fetchL2OrderBook'):