Update function-head for _get_stop_params
This commit is contained in:
parent
cf6b75a3f3
commit
6e0ca058f4
@ -1110,7 +1110,7 @@ class Exchange:
|
|||||||
'In stoploss limit order, stop price should be more than limit price')
|
'In stoploss limit order, stop price should be more than limit price')
|
||||||
return limit_rate
|
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()
|
params = self._params.copy()
|
||||||
# Verify if stopPrice works for your exchange!
|
# Verify if stopPrice works for your exchange!
|
||||||
params.update({'stopPrice': stop_price})
|
params.update({'stopPrice': stop_price})
|
||||||
@ -1159,7 +1159,8 @@ class Exchange:
|
|||||||
return dry_order
|
return dry_order
|
||||||
|
|
||||||
try:
|
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:
|
if self.trading_mode == TradingMode.FUTURES:
|
||||||
params['reduceOnly'] = True
|
params['reduceOnly'] = True
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
from freqtrade.constants import BuySell
|
||||||
from freqtrade.exchange import Exchange
|
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 = self._params.copy()
|
||||||
params.update({
|
params.update({
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
from freqtrade.constants import BuySell
|
||||||
from freqtrade.exchange import Exchange
|
from freqtrade.exchange import Exchange
|
||||||
|
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ class Kucoin(Exchange):
|
|||||||
or stop_loss > float(order['stopPrice'])
|
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 = self._params.copy()
|
||||||
params.update({
|
params.update({
|
||||||
|
Loading…
Reference in New Issue
Block a user