BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

The program stucked after 'Connected to WS.' #28

Closed zlwolf236 closed 7 years ago

zlwolf236 commented 7 years ago

Hi, I used exactly the same main trying to connect to the websocket using endpoint="wss://www.bitmex.com/realtime"

It went through Authentication and successfully connected to WebSocket; however, the program stucked at

if api_key: self.__wait_for_account()

part. Can anyone tell me what I did wrong here? I tried to copy the whole link to a browser and it says "Upgrade Required"

Please help, thank you very much

lechiffreqc commented 7 years ago

Same problem here. Code was working well, then now got stuck here: def __wait_for_account(self): '''On subscribe, this data will come down. Wait for it.'''

Wait for the keys to show up from the ws

    while not {'margin', 'position', 'order', 'orderBook25'} <= set(self.data):
lechiffreqc commented 7 years ago

I don't know if it will help, but I removed the parameter

'orderBook25' from def __wait_for_account(self): in bitmex_websocket.py

I don't know if I am right, but according to available data from https://www.bitmex.com/app/wsAPI#Connecting there is not 'orderBook25' subject in authentificated channel.

Since I have removed this parameter, I am able to login again.

Good luck.

STRML commented 7 years ago

Thanks, pushed a fix.