From 553da850ce1e1492241180035b68648298af6372 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Thu, 10 Feb 2022 09:41:57 -0600 Subject: [PATCH] binance futures stoploss --- freqtrade/exchange/binance.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index ef5c65f5b..6a2251d65 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -45,7 +45,9 @@ class Binance(Exchange): :param side: "buy" or "sell" """ - return order['type'] == 'stop_loss_limit' and ( + ordertype = 'stop' if self.trading_mode == TradingMode.FUTURES else 'stop_loss_limit' + + return order['type'] == ordertype and ( (side == "sell" and stop_loss > float(order['info']['stopPrice'])) or (side == "buy" and stop_loss < float(order['info']['stopPrice'])) ) @@ -67,7 +69,7 @@ class Binance(Exchange): else: rate = stop_price * (2 - limit_price_pct) - ordertype = "stop_loss_limit" + ordertype = 'stop' if self.trading_mode == TradingMode.FUTURES else 'stop_loss_limit' stop_price = self.price_to_precision(pair, stop_price)