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

无法打开CTA回测,如下是报错信息,请教一下大家原因

Traceback (most recent call last):
File "E:\Python_Project\VNPY\venv\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 276, in open_widget
widget = widget_class(self.main_engine, self.event_engine)
File "E:\Python_Project\VNPY\venv\lib\site-packages\vnpy_ctabacktester\ui\widget.py", line 53, in init
self.init_ui()
File "E:\Python_Project\VNPY\venv\lib\site-packages\vnpy_ctabacktester\ui\widget.py", line 188, in init_ui
self.chart: BacktesterChart = BacktesterChart()
File "E:\Python_Project\VNPY\venv\lib\site-packages\vnpy_ctabacktester\ui\widget.py", line 719, in init
self.init_ui()
File "E:\Python_Project\VNPY\venv\lib\site-packages\vnpy_ctabacktester\ui\widget.py", line 758, in init_ui
self.profit_pnl_bar = pg.BarGraphItem(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyqtgraph\graphicsItems\BarGraphItem.py", line 62, in init
self.setOpts(opts)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyqtgraph\graphicsItems\BarGraphItem.py", line 68, in setOpts
self._prepareData()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pyqtgraph\graphicsItems\BarGraphItem.py", line 188, in _prepareData
xmn, xmx = np.min(x0), np.max(x1)
File "<__array_function__ internals>", line 180, in amin
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 2916, in amin
return _wrapreduction(a, np.minimum, 'min', axis, None, out,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out,
passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

Member
avatar
加入于:
帖子: 1509
声望: 109

回测的日期数据为空,导致绘图失败,检查下历史数据吧

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

MTF wrote:

回测的日期数据为空,导致绘图失败,检查下历史数据吧
多谢建议,目前已修正。
问题是pyqtgraph的版本。报错的版本是0.13.2;之后将pyqtgraph的版本降低至0.12.3就好了。

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

沪公网安备 31011502017034号

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