ccxt: KuCoin spot stop loss doesn't work

Operating System

Windows

Programming Languages

JS

CCXT Version

4.0.32

Description

Stop loss orders, using the unified method, on KuCoin doesn’t work. As an example, this is what I did:

await exchange.createOrder(‘SOL/USDT’, ‘limit’, ‘sell’, 0.0869, 26.5, { stopLossPrice: 26.6 });

The SOL/USDT price was around 26.85 when I created the order. The order was immediately triggered and filled. Instead, it should only be triggered when the price drops below 26.6.

The same code works well with Binance.

Now, I tried the above 3 times in a row. And interestingly, the 2nd time it did work as expected. I then manually canceled the stop loss, and ran the exact same code again. And the SOL was immediately sold.

Any idea what could be the problem?

Code

  

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I’ve tested and indeed stop limit orders now work, so that’s great. However, I’ve noticed that when placing or canceling these stop limit orders on KuCoin, those events are not caught by the watchOrders() method. I’ve validated the exact same code with Binance, and then it works without problems. The problem is 100% reproducible on KuCoin.

I figured, I’ll report it in this thread. But if you want me to create a new issue, let me know.

better to open a separate/new issue for different/WS problem 👍

Excellent, thanks for the quick fix @ttodua!