diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index 1b6496a64..03546dcf9 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -53,8 +53,8 @@ class Binance(Exchange): 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'])) + (side == "sell" and stop_loss > float(order['stopPrice'])) or + (side == "buy" and stop_loss < float(order['stopPrice'])) ) def get_tickers(self, symbols: Optional[List[str]] = None, cached: bool = False) -> Dict: diff --git a/tests/exchange/test_binance.py b/tests/exchange/test_binance.py index 324be9962..45f8a3817 100644 --- a/tests/exchange/test_binance.py +++ b/tests/exchange/test_binance.py @@ -154,6 +154,7 @@ def test_stoploss_adjust_binance(mocker, default_conf, sl1, sl2, sl3, side): order = { 'type': 'stop_loss_limit', 'price': 1500, + 'stopPrice': 1500, 'info': {'stopPrice': 1500}, } assert exchange.stoploss_adjust(sl1, order, side=side) diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 23ef4ffc2..5a5467370 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -1775,9 +1775,7 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee, caplog, 'type': 'stop_loss_limit', 'price': 3, 'average': 2, - 'info': { - 'stopPrice': '2.178' - } + 'stopPrice': '2.178' }) mocker.patch('freqtrade.exchange.Exchange.fetch_stoploss_order', stoploss_order_hanging)