AttributeError: 'BinanceFutures' object has no attribute 'ws'
dekacypher opened this issue · comments
Hi, I have Futures, Reading and European Options activated on my Binance API Key and also I've got it unresticted mode, its only for my IP address. Please help I have no idea what's wrong.
python main.py --demo --account binanceaccount1 --exchange binance --pair ZENUSDT --strategy Sample
INFO - Bot Mode : Trade INFO - pair: ZENUSDT INFO - timeframes: ['15m'] Traceback (most recent call last): File "main.py", line 38, in <module> bot.run() ... File "binance_futures_api.py", line 268, in _handle_response raise BinanceAPIException(self.response) src.exchange.binance_futures.exceptions.BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action, request ip: XXX.XXX.XXX.XXX INFO - Stopping Bot Exception ignored in: <function Bot.__del__ at 0x16a1676d0> ... AttributeError: 'BinanceFutures' object has no attribute 'ws'
Hi, you are using --demo
flag which connects to binance testnet. Are you sure you are using their testnet api keys?
No I wasn't, thanks for the input I'll do that rn
How do i fix this? I've already tried fixing my network but that doesn't seem to be the problem.
`
2023-08-18 19:02:23,338 - INFO - Websocket On Close: Restart
2023-08-18 19:02:26,020 - ERROR - Handshake status 400 Bad Request
2023-08-18 19:02:26,021 - ERROR - Traceback (most recent call last):
File "[REDACTED]/lib/python3.10/site-packages/websocket/_app.py", line 239, in run_forever
self.sock.connect(
...
File "[REDACTED]/lib/python3.10/site-packages/websocket/_handshake.py", line 140, in _get_resp_headers
raise WebSocketBadStatusException("Handshake status %d %s", status, status_message)
websocket._exceptions.WebSocketBadStatusException: Handshake status 400 Bad Request
2023-08-18 19:02:26,022 - INFO - Websocket On Close: Restart
... [REPEATED ERRORS OMITTED FOR BREVITY] ...
2023-08-18 19:02:36,512 - INFO - Websocket On Close: Restart
`
I see that you are trying to use python 3.10. Are you using Ubuntu 22.04?
matplotlib==3.7.1
numpy==1.24
ta-lib==0.4.24
pandas==1.5.3
bravado
websocket-client==0.52.0
hyperopt
pyti
google-api-python-client
oauth2client
discord-webhook==0.16.3
try to replace the contents of requirements.txt with the above code snippet and check!
How do i fix this? I've already tried fixing my network but that doesn't seem to be the problem. ` 2023-08-18 19:02:23,338 - INFO - Websocket On Close: Restart 2023-08-18 19:02:26,020 - ERROR - Handshake status 400 Bad Request 2023-08-18 19:02:26,021 - ERROR - Traceback (most recent call last): File "[REDACTED]/lib/python3.10/site-packages/websocket/_app.py", line 239, in run_forever self.sock.connect( ... File "[REDACTED]/lib/python3.10/site-packages/websocket/_handshake.py", line 140, in _get_resp_headers raise WebSocketBadStatusException("Handshake status %d %s", status, status_message) websocket._exceptions.WebSocketBadStatusException: Handshake status 400 Bad Request
2023-08-18 19:02:26,022 - INFO - Websocket On Close: Restart ... [REPEATED ERRORS OMITTED FOR BREVITY] ...
2023-08-18 19:02:36,512 - INFO - Websocket On Close: Restart `
Should be fixed now.