From 054b63700180913d88535e79c5e6d3bde244ae81 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Fri, 25 Mar 2022 06:56:05 -0600 Subject: [PATCH] Add amount_to_contracts and order_contracts_to_amount to stoploss --- freqtrade/exchange/exchange.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index fe47ca4d1..6ce6e3d54 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1103,11 +1103,12 @@ class Exchange: if self.trading_mode == TradingMode.FUTURES: params['reduceOnly'] = True - amount = self.amount_to_precision(pair, amount) + amount = self.amount_to_precision(pair, self._amount_to_contracts(pair, amount)) self._lev_prep(pair, leverage, side) order = self._api.create_order(symbol=pair, type=ordertype, side=side, amount=amount, price=rate, params=params) + order = self._order_contracts_to_amount(order) logger.info(f"stoploss {user_order_type} order added for {pair}. " f"stop price: {stop_price}. limit: {rate}") self._log_exchange_response('create_stoploss_order', order)