我尝试了
SYMBOL = “KQ.i@SHFE.ni” # 设置合约代码
报错看不懂:
Exception ignored in: <coroutine object WebSocketCommonProtocol.close_connection at 0x000000000C309AC8>
Traceback (most recent call last):
File “C:\ProgramData\Miniconda3\lib\site-packages\websockets\protocol.py”, line 1206, in close_connection
File “C:\ProgramData\Miniconda3\lib\site-packages\websockets\protocol.py”, line 1229, in wait_for_connection_lost
File “C:\ProgramData\Miniconda3\lib\asyncio\tasks.py”, line 400, in wait_for
File “C:\ProgramData\Miniconda3\lib\asyncio\base_events.py”, line 657, in call_later
File “C:\ProgramData\Miniconda3\lib\asyncio\base_events.py”, line 667, in call_at
File “C:\ProgramData\Miniconda3\lib\asyncio\base_events.py”, line 480, in _check_closed
RuntimeError: Event loop is closed