From 6e0ca058f4054ee80bcd2af7c5178e1d403cfc4f Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 26 Oct 2022 07:12:49 +0200 Subject: [PATCH] Update function-head for _get_stop_params --- freqtrade/exchange/exchange.py | 5 +++-- freqtrade/exchange/huobi.py | 3 ++- freqtrade/exchange/kucoin.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index cdbe1804e..5959e457e 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1110,7 +1110,7 @@ class Exchange: 'In stoploss limit order, stop price should be more than limit price') return limit_rate - def _get_stop_params(self, ordertype: str, stop_price: float) -> Dict: + def _get_stop_params(self, side: BuySell, ordertype: str, stop_price: float) -> Dict: params = self._params.copy() # Verify if stopPrice works for your exchange! params.update({'stopPrice': stop_price}) @@ -1159,7 +1159,8 @@ class Exchange: return dry_order try: - params = self._get_stop_params(ordertype=ordertype, stop_price=stop_price_norm) + params = self._get_stop_params(side=side, ordertype=ordertype, + stop_price=stop_price_norm) if self.trading_mode == TradingMode.FUTURES: params['reduceOnly'] = True diff --git a/freqtrade/exchange/huobi.py b/freqtrade/exchange/huobi.py index 736515dec..714b154aa 100644 --- a/freqtrade/exchange/huobi.py +++ b/freqtrade/exchange/huobi.py @@ -2,6 +2,7 @@ import logging from typing import Dict +from freqtrade.constants import BuySell from freqtrade.exchange import Exchange @@ -35,7 +36,7 @@ class Huobi(Exchange): ) ) - def _get_stop_params(self, ordertype: str, stop_price: float) -> Dict: + def _get_stop_params(self, side: BuySell, ordertype: str, stop_price: float) -> Dict: params = self._params.copy() params.update({ diff --git a/freqtrade/exchange/kucoin.py b/freqtrade/exchange/kucoin.py index f05fd3f56..10b0f7c7e 100644 --- a/freqtrade/exchange/kucoin.py +++ b/freqtrade/exchange/kucoin.py @@ -2,6 +2,7 @@ import logging from typing import Dict +from freqtrade.constants import BuySell from freqtrade.exchange import Exchange @@ -37,7 +38,7 @@ class Kucoin(Exchange): or stop_loss > float(order['stopPrice']) ) - def _get_stop_params(self, ordertype: str, stop_price: float) -> Dict: + def _get_stop_params(self, side: BuySell, ordertype: str, stop_price: float) -> Dict: params = self._params.copy() params.update({