Split validate_order_types to 2 functions to allow selective application
This commit is contained in:
parent
8c0c2496c2
commit
953be8a7f8
@ -600,7 +600,12 @@ class Exchange:
|
|||||||
if not self.exchange_has('createMarketOrder'):
|
if not self.exchange_has('createMarketOrder'):
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
f'Exchange {self.name} does not support market orders.')
|
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")
|
if (order_types.get("stoploss_on_exchange")
|
||||||
and not self._ft_has.get("stoploss_on_exchange", False)):
|
and not self._ft_has.get("stoploss_on_exchange", False)):
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
|
@ -56,8 +56,7 @@ class Gateio(Exchange):
|
|||||||
if any(v == 'market' for k, v in order_types.items()):
|
if any(v == 'market' for k, v in order_types.items()):
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
f'Exchange {self.name} does not support market orders.')
|
f'Exchange {self.name} does not support market orders.')
|
||||||
else:
|
super().validate_stop_ordertypes(order_types)
|
||||||
super().validate_ordertypes(order_types)
|
|
||||||
|
|
||||||
def _get_params(
|
def _get_params(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user