vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 2
声望: 0

启动策略,显示:触发异常已停止,代码如下,请教大神是什么原因
Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 586, in call_strategyfunc
func(params)
File "C:\Users\Administrator.vntrader\strategies\MACD
strategy.py", line 87, in on_tick
self.bg.update_tick(tick)
File "C:\vnstudio\lib\site-packages\vnpy\trader\utility.py", line 198, in update_tick
self.onbar(self.bar)
File "C:\Users\Administrator.vntrader\strategies\MACD
strategy.py", line 103, in on_bar
self.DIFF = talib.EMA(self.close_Array,timeperiod=self.P1)-talib.EMA(self.close_Array,timeperiod=self.P2)
AttributeError: 'MACDStrategy' object has no attribute 'close_Array'

Administrator
avatar
加入于:
帖子: 4188
声望: 235

close_Array对象不存在,检查下这个变量你自己创建了没有吧

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