From 8639c1f23d89121d97775daa5157939395f10e07 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 17 Sep 2022 10:56:27 +0200 Subject: [PATCH] Reduce complexity in binance stoploss handling --- freqtrade/exchange/binance.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index 026ba1c65..a012aa3a3 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -48,13 +48,12 @@ class Binance(Exchange): Returns True if adjustment is necessary. :param side: "buy" or "sell" """ - - ordertype = 'stop' if self.trading_mode == TradingMode.FUTURES else 'stop_loss_limit' + order_types = ('stop_loss_limit', 'stop', 'stop_market') return ( order.get('stopPrice', None) is None or ( - order['type'] == ordertype + order['type'] in order_types and ( (side == "sell" and stop_loss > float(order['stopPrice'])) or (side == "buy" and stop_loss < float(order['stopPrice']))