From 953be8a7f86fbb832d377930dd78cd0ab5d6cc04 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 7 Feb 2023 18:00:44 +0100 Subject: [PATCH] Split validate_order_types to 2 functions to allow selective application --- freqtrade/exchange/exchange.py | 5 +++++ freqtrade/exchange/gateio.py | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index fda775547..aa34d6156 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -600,7 +600,12 @@ class Exchange: if not self.exchange_has('createMarketOrder'): raise OperationalException( f'Exchange {self.name} does not support market orders.') + self.validate_stop_ordertypes(order_types) + def validate_stop_ordertypes(self, order_types: Dict) -> None: + """ + Validate stoploss order types + """ if (order_types.get("stoploss_on_exchange") and not self._ft_has.get("stoploss_on_exchange", False)): raise OperationalException( diff --git a/freqtrade/exchange/gateio.py b/freqtrade/exchange/gateio.py index 8960e163d..48302c522 100644 --- a/freqtrade/exchange/gateio.py +++ b/freqtrade/exchange/gateio.py @@ -56,8 +56,7 @@ class Gateio(Exchange): if any(v == 'market' for k, v in order_types.items()): raise OperationalException( f'Exchange {self.name} does not support market orders.') - else: - super().validate_ordertypes(order_types) + super().validate_stop_ordertypes(order_types) def _get_params( self,