D:\Python\tcl\pythonProject1\.venv\Scripts\python.exe D:\Python\tcl\pythonProject1\.venv\Lib\期货仿真.py
在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/
2024-03-14 14:08:55 – INFO – 通知 : 与 wss://free-api.shinnytech.com/t/nfmd/front/mobile 的网络连接已建立
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\期货仿真.py”, line 10, in <module>
ticks = api.get_tick_serial(“SHFE.au9999”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py”, line 820, in get_tick_serial
if not self.wait_update(deadline=deadline, _task=[task, serial[“df”].__dict__[“_task”]]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py”, line 1905, in wait_update
self._run_until_task_done(task=update_task, deadline=deadline)
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 88, in _run_until_task_done
self._run_once()
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 57, in _run_once
raise self._exceptions.pop(0)
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\symbols.py”, line 41, in _run
raise Exception(f”查询合约服务报错 {query_result[‘error’]}”)
Exception: 查询合约服务报错 failed to execute graphql operation, errors: [variable instrument_id: [SHFE.au9999] contains non-existent instrument: SHFE.au9999]
Task was destroyed but it is pending!
task: <Task pending name=’Task-1′ coro=<TqBaseApi._windows_patch() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py:119> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-2′ coro=<TqApi._notify_watcher() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py:3639> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Exception ignored in: <coroutine object TqApi._notify_watcher at 0x0000018E7C710040>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py”, line 3639, in _notify_watcher
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\channel.py”, line 143, in __anext__
File “D:\Python\Lib\asyncio\queues.py”, line 160, in get
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending name=’Task-3′ coro=<TqConnect._run() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\connect.py:190> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-4′ coro=<TqReconnect._run() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\connect.py:274> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-6′ coro=<TqTradingStatus._run() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\trading_status.py:26> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-7′ coro=<BaseSim._run() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\tradeable\sim\basesim.py:78> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-8′ coro=<TqWebHelper._run() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\tqwebhelper.py:80> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-9′ coro=<DataExtension._run() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\data_extension.py:85> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Exception ignored in: <coroutine object TqConnect._run at 0x0000018E7C437780>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\connect.py”, line 157, in _run
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\client.py”, line 637, in __aexit__
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py”, line 769, in close
File “D:\Python\Lib\asyncio\timeouts.py”, line 145, in timeout
RuntimeError: no running event loop
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-21′ coro=<TqConnect._send_handler() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\connect.py:245> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqReconnect._run at 0x0000018E692BE880>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\connect.py”, line 324, in _run
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-10′ coro=<TqReconnect._send_handler() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\connect.py:328> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqTradingStatus._run at 0x0000018E7C5E6E60>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\trading_status.py”, line 26, in _run
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseModule.py”, line 47, in _run
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-12′ coro=<TqModule._up_handler() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseModule.py:51> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object BaseSim._run at 0x0000018E690B22B0>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\tradeable\sim\basesim.py”, line 83, in _run
File “D:\Python\Lib\asyncio\tasks.py”, line 762, in gather
File “D:\Python\Lib\asyncio\events.py”, line 786, in get_event_loop_policy
File “D:\Python\Lib\asyncio\events.py”, line 779, in _init_event_loop_policy
ImportError: sys.meta_path is None, Python is likely shutting down
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-14′ coro=<TqModule._up_handler() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseModule.py:51> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqWebHelper._run at 0x0000018E7C41AA70>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\tqwebhelper.py”, line 85, in _run
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-15′ coro=<TqWebHelper._data_handler_without_web() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\tqwebhelper.py:168> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object DataExtension._run at 0x0000018E7C6DD040>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\data_extension.py”, line 103, in _run
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-16′ coro=<DataExtension._md_handler() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\data_extension.py:107> wait_for=<Future cancelled>>
Task was destroyed but it is pending!
task: <Task pending name=’Task-13′ coro=<TqModule._up_handler() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseModule.py:51> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Exception ignored in: <coroutine object TqModule._up_handler at 0x0000018E7F4DB5B0>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseModule.py”, line 51, in _up_handler
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\channel.py”, line 143, in __anext__
File “D:\Python\Lib\asyncio\queues.py”, line 160, in get
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending name=’Task-18′ coro=<WebSocketCommonProtocol.transfer_data() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py:963> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[Task.task_wakeup()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-19′ coro=<WebSocketCommonProtocol.keepalive_ping() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py:1254> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Task was destroyed but it is pending!
task: <Task pending name=’Task-20′ coro=<WebSocketCommonProtocol.close_connection() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py:1301> wait_for=<Task pending name=’Task-18′ coro=<WebSocketCommonProtocol.transfer_data() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py:963> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[Task.task_wakeup()]>>
Exception ignored in: <coroutine object WebSocketCommonProtocol.close_connection at 0x0000018E742D4520>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py”, line 1337, in close_connection
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py”, line 1355, in close_transport
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\websockets\legacy\protocol.py”, line 1379, in wait_for_connection_lost
File “D:\Python\Lib\asyncio\timeouts.py”, line 145, in timeout
RuntimeError: no running event loop
Task was destroyed but it is pending!
task: <Task cancelling name=’Task-25′ coro=<TqApi._fetch_msg() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py:3653> wait_for=<Future cancelled> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-22′ coro=<TqApi._get_serial_async() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py:732> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-23′ coro=<TqDataFrame.async_update() running at D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\objs_not_entity.py:192> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[TqBaseApi._on_task_done()]>
Exception ignored in: <coroutine object TqApi._get_serial_async at 0x0000018E068F92A0>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py”, line 732, in _get_serial_async
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\api.py”, line 523, in _ensure_symbol_async
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\channel.py”, line 143, in __anext__
File “D:\Python\Lib\asyncio\queues.py”, line 160, in get
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <coroutine object TqDataFrame.async_update at 0x0000018E7F50FF10>
Traceback (most recent call last):
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\objs_not_entity.py”, line 192, in async_update
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\channel.py”, line 143, in __anext__
File “D:\Python\Lib\asyncio\queues.py”, line 160, in get
File “D:\Python\tcl\pythonProject1\.venv\Lib\site-packages\tqsdk\baseApi.py”, line 50, in _call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 793, in call_soon
File “D:\Python\Lib\asyncio\base_events.py”, line 540, in _check_closed
RuntimeError: Event loop is closed
进程已结束,退出代码为 1