Update ftx.py

Stoploss price should be set as param instead of passing it as price according to ccxt
This commit is contained in:
Chris van de Steeg 2021-04-12 16:01:46 +02:00 committed by GitHub
parent f1ac6853fc
commit d4dc05980c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,10 +63,11 @@ class Ftx(Exchange):
# set orderPrice to place limit order, otherwise it's a market order # set orderPrice to place limit order, otherwise it's a market order
params['orderPrice'] = limit_rate params['orderPrice'] = limit_rate
params['stopPrice'] = stop_price
amount = self.amount_to_precision(pair, amount) amount = self.amount_to_precision(pair, amount)
order = self._api.create_order(symbol=pair, type=ordertype, side='sell', order = self._api.create_order(symbol=pair, type=ordertype, side='sell',
amount=amount, price=stop_price, params=params) amount=amount, params=params)
logger.info('stoploss order added for %s. ' logger.info('stoploss order added for %s. '
'stop price: %s.', pair, stop_price) 'stop price: %s.', pair, stop_price)
return order return order