Simplify stoploss behavior by combining more commonalities

This commit is contained in:
Matthias
2022-10-26 07:14:33 +02:00
parent 6e0ca058f4
commit 255f38537e
4 changed files with 5 additions and 26 deletions

View File

@@ -1079,8 +1079,11 @@ class Exchange:
if not self._ft_has.get('stoploss_on_exchange'):
raise OperationalException(f"stoploss is not implemented for {self.name}.")
return ((side == "sell" and stop_loss > float(order['stopPrice'])) or
return (
order.get('stopPrice', None) is None
or ((side == "sell" and stop_loss > float(order['stopPrice'])) or
(side == "buy" and stop_loss < float(order['stopPrice'])))
)
def _get_stop_order_type(self, user_order_type) -> Tuple[str, str]: