yasinkuyu / binance-trader

💰 Cryptocurrency Trading Bot for Binance (Experimental)
2.51k stars 826 forks source link

Keyerror: 'lastPrice' #190

Closed Maathouse closed 6 years ago

Maathouse commented 6 years ago

Hi,

I'm getting the following error, seemingly at random. Occurs more often when I run multiple bots. If it happens, all bots crash at once.

Traceback (most recent call last): line 51, in t.run() File "./app\Trading.py", line 494, in run self.action(symbol) File "./app\Trading.py", line 302, in action lastPrice = float(ticker['lastPrice']) KeyError: 'lastPrice'

Any suggestions?

Thanks in advance!

DVenerM commented 6 years ago

Message from the server when this error occurs: {'code': -1003, 'msg': 'Too many requests; current limit is 1200 requests per minute. Please use the websocket for live updates to avoid polling the API.'} What to do next I do not know.

Maathouse commented 6 years ago

Ah oke. Where can I adjust the requests per minute?

EDIT: Found it. Adjusting the 'wait time' in the 'trader' file does the job.

DVenerM commented 6 years ago

Yes I put 1, get better

Maathouse commented 6 years ago

Hmm oke. Kinda strange since I had the same settings as before the update. Think they narrowed it.

yasinkuyu commented 6 years ago

Looks like a temporary connection problem. What's the latest situation?

Maathouse commented 6 years ago

I adjusted the request time to 1.5sec. Never got the error afterwards.