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

Error after reloading pressing F3 #232

Closed nikolayromenskiy closed 3 months ago

nikolayromenskiy commented 3 months ago

This error occurs when (1) two markets connected, (2) the second one is currently selected, (3) you press F3 button to reload Tmatic.

2024-05-21 11:17:31,731 - websocket - INFO - Websocket connected 2024-05-21 11:17:31,732 - websocket - INFO - Websocket connected 2024-05-21 11:17:31,732 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 (Auth) connected 2024-05-21 11:17:31,733 - api.bybit.pybit._websocket_stream - INFO - WebSocket Unified V5 connected 2024-05-21 11:17:31,734 - api.bybit.ws - INFO - ws subscription - orderbook_stream - category - linear - symbol - ('BTCUSDT', 'linear', 'Bybit') 2024-05-21 11:17:31,734 - api.bybit.ws - INFO - ws subscription - ticker_stream - category - linear - symbol - ('BTCUSDT', 'linear', 'Bybit') 2024-05-21 11:17:31,758 - api.bybit.agent - INFO - In trading_history - sending get_executions() - category - spot - startTime - 2024-05-20 10:55:25+00:00 2024-05-21 11:17:31,759 - api.bybit.agent - INFO - In open_orders - sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'spot', 'cursor': 'no'} 2024-05-21 11:17:31,760 - api.bitmex.ws - INFO - (https) sending GET to execution/tradeHistory?count=500&reverse=false&startTime=2024-05-21 07:56:44: "" 2024-05-21 11:17:31,766 - api.bybit.agent - INFO - In trading_history - sending get_executions() - category - inverse - startTime - 2024-05-20 10:55:25+00:00 2024-05-21 11:17:31,769 - api.bybit.agent - INFO - In open_orders - sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'linear', 'settleCoin': 'USDT', 'cursor': 'no'} 2024-05-21 11:17:31,770 - api.bybit.agent - INFO - In trading_history - sending get_executions() - category - option - startTime - 2024-05-20 10:55:25+00:00 2024-05-21 11:17:31,773 - api.bybit.agent - INFO - In trading_history - sending get_executions() - category - linear - startTime - 2024-05-20 10:55:25+00:00 2024-05-21 11:17:31,999 - api.bybit.agent - INFO - In trading_history - sending get_executions() - category - linear - startTime - 2024-05-20 10:55:25+00:00 Bybit - loading trading history, startTime=2024-05-20 10:55:25+00:00, received: 1 records. 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_240521/main.py", line 16, in refresh connect.refresh() File "/home/rmn/tmatic_240521/connect.py", line 145, in refresh Function.refresh_on_screen(Markets[var.current_market], utc=utc) File "/home/rmn/tmatic_240521/functions.py", line 709, in refresh_on_screen Function.refresh_tables(self) File "/home/rmn/tmatic_240521/functions.py", line 728, in refresh_tables if compare != tree.cache[num]: IndexError: list index out of range

evgrmn commented 3 months ago

During the reboot, the program sets the first market in the list, for example Bybit, as the default. Then it tries to display information on the screen, but the tables are still configured for the second market on the list. In one of the tables, the default market has more rows than the current one. Thus IndexError: list index out of range.

Solution: removed the line var.current_market = var.market_list[0] in the connect.py file, clear_params() function.