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

Windows launch: 'NoneType' object is not subscriptable #243

Closed nikolayromenskiy closed 3 months ago

nikolayromenskiy commented 3 months ago

2024-06-09 07:08:50,569 - root - INFO -

hello

2024-06-09 07:08:50,569 - api.bitmex.http - INFO - (https) sending GET to instrument/active: "" 2024-06-09 07:08:50,569 - api.bybit.ws - INFO - Bybit - Websocket closed 2024-06-09 07:08:50,569 - api.bybit.agent - INFO - Sending get_instruments_info() - category - spot 2024-06-09 07:08:50,579 - api.bybit.agent - INFO - Sending get_instruments_info() - category - inverse 2024-06-09 07:08:50,580 - api.bybit.agent - INFO - Sending get_instruments_info() - category - option 2024-06-09 07:08:50,580 - api.bybit.agent - INFO - Sending get_instruments_info() - category - linear 2024-06-09 07:08:51,343 - api.bitmex.http - INFO - (https) sending GET to order?filter=%7B%22open%22%3A%20true%7D&reverse=false: "" 2024-06-09 07:08:51,422 - api.bitmex.ws - INFO - Connecting to websocket 2024-06-09 07:08:51,422 - api.bitmex.ws - INFO - Authenticating with API key. 2024-06-09 07:08:51,422 - api.bitmex.http - INFO - (https) sending GET to user: "" 2024-06-09 07:08:51,422 - api.bitmex.http - INFO - (https) sending GET to position: "" 2024-06-09 07:08:51,689 - websocket - INFO - Websocket connected 2024-06-09 07:08:51,705 - api.bybit.agent - INFO - Sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'spot', 'cursor': 'no'} 2024-06-09 07:08:51,705 - api.bybit.agent - INFO - Sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'linear', 'settleCoin': 'USDT', 'cursor': 'no'} 2024-06-09 07:08:51,939 - api.bybit.agent - INFO - Sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'linear', 'settleCoin': 'USDT', 'cursor': '48af409c-0b02-42f0-9bd2-6a4838f632aa%3A1717915500521%2Caa2205dd-6474-4199-9540-67c7e709a1d7%3A1716477047327'} 2024-06-09 07:08:52,159 - api.bybit.ws - INFO - Connecting to websocket 2024-06-09 07:08:52,159 - api.bybit.agent - INFO - Sending get_uid_wallet_type() 2024-06-09 07:08:52,159 - api.bybit.agent - INFO - Sending get_wallet_balance() - accountType - UNIFIED 2024-06-09 07:08:52,159 - api.bybit.agent - INFO - Sending get_positions() - category - linear - settlCurrency - USDT 2024-06-09 07:08:52,159 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 attempting connection... 2024-06-09 07:08:52,159 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) attempting connection... 2024-06-09 07:08:52,482 - api.bybit.agent - INFO - Sending get_wallet_balance() - accountType - CONTRACT 2024-06-09 07:08:52,547 - api.bitmex.ws - INFO - Connected to websocket. 2024-06-09 07:08:53,403 - api.bitmex.ws - INFO - Data received. Continuing. 2024-06-09 07:08:55,328 - websocket - INFO - Websocket connected 2024-06-09 07:08:55,328 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 connected 2024-06-09 07:08:55,433 - api.bitmex.http - INFO - (https) sending GET to execution/tradeHistory?count=500&reverse=false&startTime=2024-06-05 07:42:12: "" 2024-06-09 07:08:55,465 - api.bybit.ws - INFO - ws subscription - orderbook_stream - category - linear - symbol - ('BTCUSDT', 'linear', 'Bybit') 2024-06-09 07:08:55,506 - api.bybit.ws - INFO - ws subscription - ticker_stream - category - linear - symbol - ('BTCUSDT', 'linear', 'Bybit') 2024-06-09 07:08:55,525 - websocket - INFO - Websocket connected 2024-06-09 07:08:55,526 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) connected 2024-06-09 07:08:55,526 - api.bybit.agent - INFO - Sending get_executions() - category - spot - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:08:55,526 - api.bybit.agent - INFO - Sending get_executions() - category - inverse - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:08:55,532 - api.bybit.agent - INFO - Sending get_executions() - category - option - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:08:55,532 - api.bybit.agent - INFO - Sending get_executions() - category - linear - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:08:55,762 - api.bybit.agent - INFO - Sending get_executions() - category - linear - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:08:56,170 - api.bybit.agent - INFO - Bybit - loading trading history, startTime=2024-06-05 08:04:40+00:00, received: 1 records. 2024-06-09 07:08:56,202 - api.bitmex.http - INFO - (https) sending GET to instrument?symbol=ADAH24: "" 2024-06-09 07:08:56,280 - api.bitmex.http - INFO - (https) sending GET to instrument?symbol=XBTH24: "" 2024-06-09 07:08:56,406 - common.init - INFO - Robot EMI=Xbt1. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,406 - common.init - INFO - Robot EMI=Xbt1_1. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,406 - common.init - INFO - Robot EMI=XbtInv1. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,406 - common.init - INFO - Robot EMI=XBT_USDT.spot. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,406 - common.init - INFO - Robot EMI=XbtInv5. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,406 - common.init - INFO - Robot EMI=Xbt5. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,453 - common.init - INFO - Robot EMI=Btc5. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:08:56,453 - common.init - INFO - Robot EMI=Btc1. Adding to 'robots' with STATUS='NOT DEFINED' Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\solot\AppData\Local\Programs\Python\Python312\Lib\tkinter__init.py", line 1962, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "C:\Users\solot\AppData\Local\Programs\Python\Python312\Lib\tkinter\init__.py", line 861, in callit func(*args) File "C:\Users\solot\Documents\tmatic_240608\main.py", line 16, in refresh connect.refresh() File "C:\Users\solot\Documents\tmatic_240608\connect.py", line 268, in refresh Function.refresh_on_screen(Markets[var.current_market], utc=utc) File "C:\Users\solot\Documents\tmatic_240608\functions.py", line 763, in refresh_on_screen Function.refresh_tables(self) File "C:\Users\solot\Documents\tmatic_240608\functions.py", line 921, in refresh_tables self.Instrument[symbol].settlCurrency[0],


TypeError: 'NoneType' object is not subscriptable
nikolayromenskiy commented 3 months ago

The same error for Linux:

2024-06-09 07:12:31,783 - functions - INFO - Emboldening SQLite 2024-06-09 07:12:33,351 - api.bitmex.ws - ERROR - Error: Connection to remote host was lost. 2024-06-09 07:12:33,351 - websocket - ERROR - Connection to remote host was lost. - goodbye 2024-06-09 07:12:33,352 - api.bitmex.ws - INFO - Bitmex - Websocket closed 2024-06-09 07:12:33,426 - api.bitmex.http - INFO - (https) sending GET to instrument/active: "" 2024-06-09 07:12:33,576 - api.bybit.pybit._websocket_stream - ERROR - WebSocket Unified V5 (Auth) (wss://stream-testnet.bybit.com/v5/private) encountered error: Connection to remote host was lost.. 2024-06-09 07:12:33,576 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) attempting connection... 2024-06-09 07:12:33,647 - api.bybit.ws - INFO - Bybit - Websocket closed 2024-06-09 07:12:33,665 - api.bybit.agent - INFO - Sending get_instruments_info() - category - spot 2024-06-09 07:12:33,688 - api.bybit.agent - INFO - Sending get_instruments_info() - category - inverse 2024-06-09 07:12:33,700 - api.bybit.agent - INFO - Sending get_instruments_info() - category - option 2024-06-09 07:12:33,707 - api.bybit.agent - INFO - Sending get_instruments_info() - category - linear 2024-06-09 07:12:33,994 - api.bitmex.http - INFO - (https) sending GET to order?filter=%7B%22open%22%3A%20true%7D&reverse=false: "" 2024-06-09 07:12:34,106 - api.bitmex.ws - INFO - Connecting to websocket 2024-06-09 07:12:34,107 - api.bitmex.ws - INFO - Authenticating with API key. 2024-06-09 07:12:34,108 - api.bitmex.http - INFO - (https) sending GET to user: "" 2024-06-09 07:12:34,134 - api.bitmex.http - INFO - (https) sending GET to position: "" 2024-06-09 07:12:34,360 - websocket - INFO - Websocket connected 2024-06-09 07:12:34,387 - websocket - ERROR - error from callback <function _WebSocketManager._connect.. at 0x767dd7f6e0e0>: 'NoneType' object has no attribute 'sock' 2024-06-09 07:12:34,398 - websocket - INFO - tearing down on exception 'NoneType' object has no attribute 'sock' 2024-06-09 07:12:34,411 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) attempting connection... 2024-06-09 07:12:34,446 - websocket - INFO - Websocket connected 2024-06-09 07:12:35,122 - api.bitmex.ws - INFO - Connected to websocket. 2024-06-09 07:12:35,191 - websocket - INFO - Websocket connected 2024-06-09 07:12:35,191 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) connected 2024-06-09 07:12:35,197 - websocket - ERROR - Connection to remote host was lost. - goodbye 2024-06-09 07:12:35,332 - api.bitmex.ws - INFO - Data received. Continuing. 2024-06-09 07:12:35,373 - api.bitmex.http - INFO - (https) sending GET to execution/tradeHistory?count=500&reverse=false&startTime=2024-06-05 07:42:12: "" 2024-06-09 07:12:35,546 - api.bybit.agent - INFO - Sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'spot', 'cursor': 'no'} 2024-06-09 07:12:35,548 - api.bybit.agent - INFO - Sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'linear', 'settleCoin': 'USDT', 'cursor': 'no'} 2024-06-09 07:12:35,644 - common.init - INFO - Robot EMI=XbtInv1. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:12:35,644 - common.init - INFO - Robot EMI=Xbt1. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:12:35,644 - common.init - INFO - Robot EMI=Xbt1_1. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:12:35,644 - common.init - INFO - Robot EMI=XBT_USDT.spot. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:12:35,645 - common.init - INFO - Robot EMI=XbtInv5. Adding to 'robots' with STATUS='NOT DEFINED' 2024-06-09 07:12:35,645 - common.init - INFO - Robot EMI=Xbt5. Adding to 'robots' with STATUS='NOT DEFINED' 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 "/usr/lib/python3.10/tkinter/init.py", line 839, in callit func(args) File "/home/rmn/tmatic_240608/main.py", line 16, in refresh connect.refresh() File "/home/rmn/tmatic_240608/connect.py", line 271, in refresh Function.refresh_on_screen(Markets[var.current_market], utc=utc) File "/home/rmn/tmatic_240608/functions.py", line 763, in refresh_on_screen Function.refresh_tables(self) File "/home/rmn/tmatic_240608/functions.py", line 921, in refresh_tables self.Instrument[symbol].settlCurrency[0], TypeError: 'NoneType' object is not subscriptable 2024-06-09 07:12:36,194 - api.bybit.agent - INFO - Sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'linear', 'settleCoin': 'USDT', 'cursor': '48af409c-0b02-42f0-9bd2-6a4838f632aa%3A1717915500521%2Caa2205dd-6474-4199-9540-67c7e709a1d7%3A1716477047327'} 2024-06-09 07:12:36,845 - api.bybit.ws - INFO - Connecting to websocket 2024-06-09 07:12:36,846 - api.bybit.agent - INFO - Sending get_uid_wallet_type() 2024-06-09 07:12:36,848 - api.bybit.agent - INFO - Sending get_wallet_balance() - accountType - UNIFIED 2024-06-09 07:12:36,849 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 attempting connection... 2024-06-09 07:12:36,850 - api.bybit.agent - INFO - Sending get_positions() - category - linear - settlCurrency - USDT 2024-06-09 07:12:36,860 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) attempting connection... 2024-06-09 07:12:37,075 - api.bybit.agent - INFO - Sending get_wallet_balance() - accountType - CONTRACT 2024-06-09 07:12:37,934 - websocket - INFO - Websocket connected 2024-06-09 07:12:37,935 - websocket - INFO - Websocket connected 2024-06-09 07:12:37,935 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 connected 2024-06-09 07:12:37,936 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) connected 2024-06-09 07:12:37,937 - api.bybit.ws - INFO - ws subscription - orderbook_stream - category - linear - symbol - ('BTCUSDT', 'linear', 'Bybit') 2024-06-09 07:12:37,938 - api.bybit.ws - INFO - ws subscription - ticker_stream - category - linear - symbol - ('BTCUSDT', 'linear', 'Bybit') 2024-06-09 07:12:37,944 - api.bybit.agent - INFO - Sending get_executions() - category - spot - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:12:37,945 - api.bybit.agent - INFO - Sending get_executions() - category - inverse - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:12:37,945 - api.bybit.agent - INFO - Sending get_executions() - category - option - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:12:37,947 - api.bybit.agent - INFO - Sending get_executions() - category - linear - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:12:38,185 - api.bybit.agent - INFO - Sending get_executions() - category - linear - startTime - 2024-06-05 08:04:40+00:00 2024-06-09 07:12:38,418 - api.bybit.agent - INFO - Bybit - loading trading history, startTime=2024-06-05 08:04:40+00:00, received: 1 records. 2024-06-09 07:12:41,446 - api.bybit.pybit._websocket_stream - ERROR - WebSocket Unified V5 (wss://stream-testnet.bybit.com/v5/public/linear) encountered error: Connection to remote host was lost.. 2024-06-09 07:12:41,447 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 attempting connection... 2024-06-09 07:12:42,474 - websocket - INFO - Websocket connected 2024-06-09 07:12:42,474 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 connected 2024-06-09 07:12:42,476 - websocket - ERROR - Connection to remote host was lost. - goodbye 2024-06-09 07:12:44,313 - api.bybit.pybit._websocket_stream - ERROR - WebSocket Unified V5 (Auth) (wss://stream-testnet.bybit.com/v5/private) encountered error: Connection to remote host was lost.. 2024-06-09 07:12:44,314 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) attempting connection... 2024-06-09 07:12:45,160 - websocket - INFO - Websocket connected 2024-06-09 07:12:45,160 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) connected 2024-06-09 07:12:45,162 - websocket - ERROR - Connection to remote host was lost. - goodbye

evgrmn commented 3 months ago

The error occurs because spot orders were placed. Tmatic does not currently support spot trading on Bitmex.