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

Traceback (most recent call last):
File "D:\project\vnpy2\vnpy\app\cta_backtester\ui\widget.py", line 303, in process_backtesting_finished_event
self.chart.set_data(df)
File "D:\project\vnpy2\vnpy\app\cta_backtester\ui\widget.py", line 831, in set_data
hist, x = np.histogram(df["net_pnl"], bins="auto")
File "<__array_function__ internals>", line 6, in histogram
File "C:\vnstudio\lib\site-packages\numpy\lib\histograms.py", line 792, in histogram
bin_edges, uniform_bins = _get_bin_edges(a, bins, range, weights)
File "C:\vnstudio\lib\site-packages\numpy\lib\histograms.py", line 448, in _get_bin_edges
endpoint=True, dtype=bin_type)
File "<__array_function__ internals>", line 6, in linspace
File "C:\vnstudio\lib\site-packages\numpy\core\function_base.py", line 128, in linspace
y = _nx.arange(0, num, dtype=dt).reshape((-1,) + (1,) * ndim(delta))
MemoryError: Unable to allocate 396. PiB for an array with shape (55718376022934928,) and data type float64

回测的时候,有一些策略交易量并不大,不知道怎样会引发这样的报错。就是右下角盈亏分布那个直方图那里报错。有哪个大神可以解答一下不?我暂时的办法是先将他报错的时候不显示咯。

Member
avatar
加入于:
帖子: 5078
声望: 306

可参考https://blog.csdn.net/com_fang_bean/article/details/106862052
https://blog.csdn.net/qq_16829085/article/details/103589450

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

遇到了这个问题!
Traceback (most recent call last):
File "D:\vnpy-master\vnpy-master\vnpy\app\cta_backtester\ui\widget.py", line 285, in process_backtesting_finished_event
self.chart.set_data(df)
File "D:\vnpy-master\vnpy-master\vnpy\app\cta_backtester\ui\widget.py", line 781, in set_data
hist, x = np.histogram(df["net_pnl"], bins="auto")
File "<__array_function__ internals>", line 6, in histogram
File "F:\vnstudio\lib\site-packages\numpy\lib\histograms.py", line 792, in histogram
bin_edges, uniform_bins = _get_bin_edges(a, bins, range, weights)
File "F:\vnstudio\lib\site-packages\numpy\lib\histograms.py", line 448, in _get_bin_edges
endpoint=True, dtype=bin_type)
File "<__array_function__ internals>", line 6, in linspace
File "F:\vnstudio\lib\site-packages\numpy\core\function_base.py", line 128, in linspace
y = _nx.arange(0, num, dtype=dt).reshape((-1,) + (1,) * ndim(delta))
MemoryError: Unable to allocate 1.71 PiB for an array with shape (241253249678267,) and data type float64

Administrator
avatar
加入于:
帖子: 4550
声望: 325

内存溢出了...请问跑的什么数据的回测,不应该有1.71PB这么大的坐标轴对象

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

沪公网安备 31011502017034号

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