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

请教下各位大神,我在没有加载数据的情况下直接点击回测按钮后就出来这个报错,是安装有问题吗?还是说可以忽略?

Traceback (most recent call last):
File "E:\Anaconda3\lib\site-packages\vnpy-2.1.3.1-py3.7.egg\vnpy\trader\ui\mainwindow.py", line 281, in open_widget
widget = widget_class(self.main_engine, self.event_engine)
File "E:\Anaconda3\lib\site-packages\vnpy-2.1.3.1-py3.7.egg\vnpy\app\cta_backtester\ui\widget.py", line 48, in init
self.init_ui()
File "E:\Anaconda3\lib\site-packages\vnpy-2.1.3.1-py3.7.egg\vnpy\app\cta_backtester\ui\widget.py", line 210, in init_ui
self.candle_dialog = CandleChartDialog()
File "E:\Anaconda3\lib\site-packages\vnpy-2.1.3.1-py3.7.egg\vnpy\app\cta_backtester\ui\widget.py", line 1142, in init
self.init_ui()
File "E:\Anaconda3\lib\site-packages\vnpy-2.1.3.1-py3.7.egg\vnpy\app\cta_backtester\ui\widget.py", line 1152, in init_ui
self.chart.add_plot("volume", maximum_height=200)
File "E:\Anaconda3\lib\site-packages\vnpy-2.1.3.1-py3.7.egg\vnpy\chart\widget.py", line 72, in add_plot
plot = pg.PlotItem(axisItems={'bottom': self._x_axis})
File "E:\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\PlotItem\PlotItem.py", line 158, in init
self.setAxisItems(axisItems)
File "E:\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\PlotItem\PlotItem.py", line 325, in setAxisItems
if axis != self.axes[k]["item"]:
KeyError: 'bottom'

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

昨晚在错误的程序往上找,这个是没有bottom字段的key,把上面这个bottom换成k, plot = pg.PlotItem(axisItems={'bottom': self._x_axis})换plot = pg.PlotItem(axisItems={'k': self._x_axis})就可以了

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

旭日东升 wrote:

昨晚在错误的程序往上找,这个是没有bottom字段的key,把上面这个bottom换成k, plot = pg.PlotItem(axisItems={'bottom': self._x_axis})换plot = pg.PlotItem(axisItems={'k': self._x_axis})就可以了

感谢!

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

也帮我解决了问题,赞!

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

是不是代码有bug,也解决了我的问题。

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