VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 7
声望: 0

报错为:
2022-12-19 21:24:10.013930 策略交易脚本启动
2022-12-19 21:24:14.682423 触发异常已停止
Traceback (most recent call last):
File "C:\veighna_studio\lib\site-packages\vnpy_scripttrader\engine.py", line 79, in run_strategy
module.run(self)
File "C:\veighna_studio\code\test1.py", line 24, in run
api.wait_update()
File "C:\veighna_studio\lib\site-packages\tqsdk\api.py", line 1872, in wait_update
self._run_until_idle(async_run=False)
File "C:\veighna_studio\lib\site-packages\tqsdk\baseApi.py", line 65, in _run_until_idle
check_handle = self._loop.call_soon(self._check_event, self._event_rev + 1)
File "C:\veighna_studio\lib\site-packages\tqsdk\baseApi.py", line 50, in _call_soon
return org_call_soon(callback, *args, **kargs)
File "C:\veighna_studio\lib\asyncio\base_events.py", line 745, in call_soon
self._check_closed()
File "C:\veighna_studio\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

代码:
api = TqApi(auth=",")

# 设置twap任务参数、
target_twap = Twap(api,"SHFE.fu2305","BUY","OPEN",20,300,1,5)

# 启动循环
while True:
    api.wait_update()
    if target_twap.is_finished():
        break
    api.close()

是连simnow的7*24小时环境测试的,请问是因为啥。。。

Member
avatar
加入于:
帖子: 1390
声望: 91

看报错应该和天勤的TQSDK有关系,换个别的数据服务(或者干错去掉)试试?

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】