Add stoploss tests for kucoin
This commit is contained in:
@@ -836,6 +836,7 @@ class Exchange:
|
||||
if stop_price_norm <= rate:
|
||||
raise OperationalException(
|
||||
'In stoploss limit order, stop price should be more than limit price')
|
||||
rate = self.price_to_precision(pair, rate)
|
||||
|
||||
if self._config['dry_run']:
|
||||
# TODO: will this work if ordertype is limit??
|
||||
@@ -848,8 +849,6 @@ class Exchange:
|
||||
|
||||
amount = self.amount_to_precision(pair, amount)
|
||||
|
||||
rate = self.price_to_precision(pair, rate)
|
||||
|
||||
order = self._api.create_order(symbol=pair, type=ordertype, side='sell',
|
||||
amount=amount, price=rate, params=params)
|
||||
logger.info(f"stoploss {user_order_type} order added for {pair}. "
|
||||
@@ -872,7 +871,8 @@ class Exchange:
|
||||
raise DDosProtection(e) from e
|
||||
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
||||
raise TemporaryError(
|
||||
f'Could not place stoploss order due to {e.__class__.__name__}. Message: {e}') from e
|
||||
f"Could not place stoploss order due to {e.__class__.__name__}. "
|
||||
f"Message: {e}") from e
|
||||
except ccxt.BaseError as e:
|
||||
raise OperationalException(e) from e
|
||||
|
||||
|
||||
Reference in New Issue
Block a user