This problem happens specifically with .pop_stream_signal_from_stream_signal_buffer(). The issue appears after I open an order with a take profit and stop loss where one of them is filled and the other is canceled.
My question is; how do we handle this error since it cannot be caught as an exception in my handler/thread?
Stacktrace:
Exception in thread _create_stream_thread: stream_id=708e339568d4-4c94-8349-c19f-2bb85a1e, time=1662466313.6806593:
Traceback (most recent call last):
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\site-packages\unicorn_binance_websocket_api\manager.py", line 529, in _create_stream_thread
loop.run_until_complete(socket.start_socket())
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\site-packages\unicorn_binance_websocket_api\sockets.py", line 141, in start_socket
received_stream_data = self.unicorn_fy.binance_com_futures_websocket(received_stream_data_json)
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\site-packages\unicorn_fy\unicorn_fy.py", line 129, in binance_com_futures_websocket
return UnicornFy.binance_futures_websocket(stream_data_json,
File "C:\Users\caspe\miniconda3\envs\tradingbot\lib\site-packages\unicorn_fy\unicorn_fy.py", line 647, in binance_futures_websocket
if stream_data['data']['e'] == 'aggTrade':
KeyError: 'data'
Version of this library.
Using v1.41.0 of unicorn websocket and 0.12.2 of unicorn-fy.
Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.
Hardware?
VPS or other cloud hosting
Operating System?
Linux
Python version?
Python3.8
Installed packages
Logging output
No response
Processing method?
stream_buffer
Used endpoint?
binance.com-futures-testnet
Issue
This problem happens specifically with
.pop_stream_signal_from_stream_signal_buffer()
. The issue appears after I open an order with a take profit and stop loss where one of them is filled and the other is canceled.My question is; how do we handle this error since it cannot be caught as an exception in my handler/thread?
Stacktrace: