kucoin fetchOrder always returns 'open' even if order is canceled.
See original GitHub issueI 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:
- Created 6 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
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.
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)