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

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 281, in open_widget
widget = widget_class(self.main_engine, self.event_engine)
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\ui\widget.py", line 52, in init
self.init_strategy_settings()
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\ui\widget.py", line 60, in init_strategy_settings
setting = self.backtester_engine.get_default_setting(class_name)
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 246, in get_default_setting
return strategy_class.get_class_parameters()
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\template.py", line 60, in get_class_parameters
class_parameters[name] = getattr(cls, name)
AttributeError: type object 'DemoStrategy' has no attribute 'fast_windowslow_window'

Member
avatar
加入于:
帖子: 3164
声望: 185

请检查一下你DemoStrategy里的fast_window和slow_window吧,是不是中间忘了加符号

Member
avatar
加入于:
帖子: 4
声望: 0

不是啊,我连模块都进不去,没机会选策略,而且自己的策略都删了。

Member
avatar
加入于:
帖子: 4
声望: 0

description

Member
avatar
加入于:
帖子: 3164
声望: 185

如果还是同一个报错的话,那应该就是你的demo_strategy里的参数里的“fast_window”和“slow_window”中间没加逗号

Member
avatar
加入于:
帖子: 4
声望: 0

好的,谢谢大佬

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

沪公网安备 31011502017034号