vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 5
声望: 0

from vnpy.app.data_recorder import RecorderEngine
from vnpy.event import Event, EventEngine
from vnpy.trader.engine import BaseEngine, MainEngine

if name == "main":
r = RecorderEngine(MainEngine, EventEngine)
r.add_tick_recording("rb2110.SHFE")
r.start()
r.run()

报错信息:

Traceback (most recent call last):
File "/home/disk1/PycharmProjects/vnpy_run/main.py", line 32, in <module>
r = RecorderEngine(MainEngine, EventEngine)
File "/home/disk1/PycharmProjects/vnpy_run/venv/lib/python3.8/site-packages/vnpy/app/data_recorder/engine.py", line 54, in init
self.register_event()
File "/home/disk1/PycharmProjects/vnpy_run/venv/lib/python3.8/site-packages/vnpy/app/data_recorder/engine.py", line 208, in register_event
self.event_engine.register(EVENT_TIMER, self.process_timer_event)
TypeError: register() missing 1 required positional argument: 'handler'

RecorderEngine在init的时候register_event报错,请问该怎么修改

Member
avatar
加入于:
帖子: 2357
声望: 148

可参考https://github.com/vnpy/vnpy/blob/master/examples/no_ui/run.py

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

沪公网安备 31011502017034号