Crypto-toolbox / btfxwss

Bitfinex Websocket API Client written in Python3
MIT License
284 stars 125 forks source link

How to cancel an order #92

Closed Michshelle closed 6 years ago

Michshelle commented 6 years ago

Hello @nlsdfnbch ,

How are you today?

I'm still working on the very basic of this API. I tried hard to cancel an order by studying the manual (https://docs.bitfinex.com/v1/reference#rest-auth-cancel-order) but failed in many ways. Currently, I'm not quite sure whether it's my code issue.

##1
od ="5369387748"
if not wss.orders.empty:
    wss.cancel_order(order_id=od)

#some other ways, but still found no luck:

##2
wss.cancel_orders()

##3
wss.cancel_orders([5369387748,])

##4
Worder={
"cid": 5369387748,
}
wss.cancel_order(**Worder)

It would be great if you can help a bit on here. Many thanks.

Best regards,

Michelle

deepbrook commented 6 years ago

Hey @Michshelle,

What do your logs say? Could you log everything from DEBUG and up and post it? That's the fastest way I can help you out.

Cheers, Nils

Michshelle commented 6 years ago

Hello @nlsdfnbch,

Just solved. order_cancel(id=5369387749). BTW, I tried the log myself. But with those compressed code, I cannot spot the problem from the log. Do you have a way to decode it? I used to find gzip lib and tried decompress(), it didn't not work. DEBUG:websocket:send: b'\x88\x82\x81VNl\x82\xbe'

deepbrook commented 6 years ago

Only the first few lines are bytes - basically everything that starts with DEBUG:websocket:, since those are log calls from the websocket library. There should be human-readable log calls later on, starting with DEBUG:btfxwss and similar.

Michshelle commented 6 years ago

No problem. I saw the rest readable log, only these code made me puzzled.