evgrmn / tmatic

Tmatic is a cryptocurrency platform designed for automated trading on the Bitmex, Bybit and Deribit crypto exchanges.
https://www.tmatic.org
GNU General Public License v3.0
25 stars 6 forks source link

Pressing F3 (reload) results in an error below #137

Closed nikolayromenskiy closed 4 months ago

nikolayromenskiy commented 4 months ago

And not only F3, but any reload.



2024-04-17 14:01:02,976 - api.bybit.ws - INFO - Websocket closed ++++ Bybit -1 _ ('BTCUSDT', 'linear', 'Bybit') 0 -----starting Bybit---- 2024-04-17 14:01:03,937 - api.bybit.ws - INFO - Connecting to websocket 2024-04-17 14:01:03,937 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 attempting connection... 2024-04-17 14:01:04,843 - websocket - INFO - Websocket connected 2024-04-17 14:01:04,844 - api.bybit.pybit._websocketstream - INFO - WebSocket Unified V5 connected ____ws subscription: linear - orderbook_stream - ('BTCUSDT', 'linear', 'Bybit') ___ws subscription: linear - ticker_stream - ('BTCUSDT', 'linear', 'Bybit') 2024-04-17 14:01:04,845 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) attempting connection... 2024-04-17 14:01:05,842 - websocket - INFO - Websocket connected 2024-04-17 14:01:05,843 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) connected _getuser wallet_balance ___get_positioninfo trading_history Bybit - loading trading history, startTime=2024-04-17 08:14:42, received: 1 records. _trading_history Bybit - loading trading history, startTime=2024-04-17 08:14:42.148000, received: 1 records. _tradinghistory Bybit - loading trading history, startTime=2024-04-17 08:14:42.148000, received: 1 records. open_orders Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.10/tkinter/init.py", line 1921, in call__ return self.func(*args) File "/home/tmatic_240417_2/connect.py", line 22, in disp.root.bind("", lambda event: terminal_reload(event)) File "/home/tmatic_240417_2/connect.py", line 139, in terminal_reload setup() File "/home/tmatic_240417_2/connect.py", line 30, in setup setup_market(Markets[name]) File "/home/tmatic_240417_2/connect.py", line 66, in setup_market ws.robots[emi]["STATUS"] = value KeyError: 'XBTUSDT.linear'

evgrmn commented 4 months ago

Solved: The robot_status variable was declared incorrectly. Tested close() functions for websockets.