策略报错”compile() arg 1 must be a string, bytes or AST object“

策略分享
标签: #<Tag:0x00007fb121eee6f0>

(maida) #1

https://i.bigquant.com/user/maida/lab/share/%E6%B5%8B%E8%AF%95003.ipynb?_t=1572426385198


(maida) #2

完全根据教程,一步步下来,结果回测不了,报错,怎么改都是报错。是不是模块里面错误?


(达达) #3


(maida) #4

UnpicklingError Traceback (most recent call last)
in ()
246 drop_na=False,
247 remove_extra_columns=False,
–> 248 user_functions={}
249 )
250

UnpicklingError: invalid load key, ‘H’.

修改后还是错误


(maida) #5

有看问题吗?又是什么原因?

AttributeError Traceback (most recent call last)
in ()
278 plot_charts=True,
279 backtest_only=False,
–> 280 benchmark=‘000300.SHA’
281 )

in m14_handle_data_bigquant_run(context, data)
26
27 #大盘风控模块,读取风控数据
—> 28 benckmark_risk=context.benckmark_risk.ix[today_date].values[0]
29
30 #当risk为1时,市场有风险,全部平仓,不再执行其它操作

AttributeError: ‘TradingAlgorithm’ object has no attribute ‘benckmark_risk’


(maida) #6

好的错误,下面这个问题怎么解读?

HDF5ExtError Traceback (most recent call last)
HDF5ExtError: HDF5 error back trace

File “H5F.c”, line 604, in H5Fopen
unable to open file
File “H5Fint.c”, line 1087, in H5F_open
unable to read superblock
File “H5Fsuper.c”, line 277, in H5F_super_read
file signature not found

End of HDF5 error back trace

Unable to open/create file ‘/var/app/data/bigquant/datasource/user/v3/e/d1/ed18f74202884c20a9a6baa0ff8fdf39T’

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
in ()
17 industry_cond=[‘全部’],
18 st_cond=[],
—> 19 output_left_data=True
20 )
21

OSError: HDF5 error back trace

File “H5F.c”, line 604, in H5Fopen
unable to open file
File “H5Fint.c”, line 1087, in H5F_open
unable to read superblock
File “H5Fsuper.c”, line 277, in H5F_super_read
file signature not found

End of HDF5 error back trace

Unable to open/create file ‘/var/app/data/bigquant/datasource/user/v3/e/d1/ed18f74202884c20a9a6baa0ff8fdf39T’


(iQuant) #7

您还是将报错策略分享出来,我们给您看一下。


(达达) #8

你下面衍生模块的线也连反了,你把鼠标移动到空心的圆圈上会提示这个接口应该连哪个上游模块。


(maida) #9

搞定了,之前用输入输出里面的’A股过滤’就总是报错,参数无论怎么填都是报错。后来换了用户模块里面的’A股st过滤’就好了。