amplitude_volatility_strategy.py
def on_bars(self, bars: Dict[str, BarData]):
""""""
self.cancel_all()
for vt_symbol, bar in bars.items():
am: ArrayManager = self.ams[vt_symbol]
am.update_bar(bar)
amplitude = (am.high() - am.low()) / am.open()
backtesting.py
show_result(AmplitudeVolatilityStrategy)
2021-09-03 12:59:53.723812 触发异常,回测终止
2021-09-03 12:59:53.725859 Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\backtesting.py", line 192, in run_backtesting
self.new_bars(dt)
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\backtesting.py", line 521, in new_bars
self.strategy.on_bars(bars)
File "C:\zwrk\vnpy\dev\amplitude_volatility_strategy.py", line 119, in on_bars
amplitude = (am.high() - am.low()) / am.open()
TypeError: 'numpy.ndarray' object is not callable
ArrayManager中有high函数呀,怎么回事?