question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kucoin fetchOrder always returns 'open' even if order is canceled.

See original GitHub issue

I don’t know if there is a good fix though. Seems there’s no way to know through kucoin api if an order is actually canceled or not and when you do for example: exchange['kucoin'].cancelOrder('5a99b4a4c0f6334473a40077', 'ACT/BCH', {'type':'BUY'}) it always returns this output:

{'code': 'OK',
 'data': None,
 'msg': 'Operation succeeded.',
 'success': True,
 'timestamp': 1520022664157}

No matter if you input a fake orderid or it’s already been canceled or whatever. It seems this is consistent with their api(maybe or maybe their api docs suck): https://kucoinapidocs.docs.apiary.io/#reference/0/trading/cancel-orders so im not sure this is a ccxt bug.

I’d say the “fix” is to set the cache to ‘canceled’(for fetchOrder) for that order if one got a response at all from the server. At least this way it should be correct 99% of the time… Not sure what the server returns if it can’t cancel for whatever reason. Perhaps they return the exact same. Anyway, id be happy with this hacky solution unless you think there’s a better way.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
AlgoBencommented, Jun 22, 2018

Negative dude. If it’s of any concession, the function works the vast majority of the time. As a periodic back up, or as a fail safe, you could refresh all open orders after the order cancel is called

Sent from Yahoo Mail on Android

On Wed, 20 Jun 2018 at 23:43, Anthony Hendersonnotifications@github.com wrote:
Any solutions found for this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

1reaction
AlgoBencommented, Apr 16, 2018

I’m doing this on python using my own code (and not CCXT or McHardy’s). Got a similar server response: {‘data’: None, ‘code’: ‘OK’, ‘timestamp’: 1523882283078, ‘msg’: ‘Operation succeeded.’, ‘success’: True}

Despite “operation succeeded”, my order still remains open. (And won’t cancel regardless of time)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open Orders Did Not Go Through - KuCoin
If an order has remained open for an extended period, it may be that the price you entered is not consistent with the...
Read more >
Exchanges — ccxt 2.4.71 documentation
The CCXT library currently supports the following 104 cryptocurrency exchange markets and trading APIs: Besides making basic market and limit orders, some ...
Read more >
KuCoin canceled my order… and got me liquidated - Reddit
I tried it once with a high leverage hail marry trade, got liquidated even tho the price never came close to my liq...
Read more >
Error Messages, by Exakat
Message File Line $this‑>id . ' allows limit orders only' /php/itbit.php 566 $this‑>id . ' returned ' . $this‑>json($response) /php/cex.php 1234 /php/cex.php 581
Read more >
Overview — ccxt 1.13.142 文档
id name ver doc countries _1broker 1Broker 2 API US _1btcxe 1BTCXE * API Panama acx ACX 2 API Australia
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found