@止一之路 下午还能回测,没动任何数据和编码,这次:Traceback (most recent call last):
File "/opt/backtest/jquser-site-packages/Kuanke-1.0-py2.7.egg/kuanke/user_space.py", line 52, in wrapper
return f(self, *args, **kwargs)
File "/opt/backtest/jquser-site-packages/Kuanke-1.0-py2.7.egg/kuanke/user_space.py", line 233, in process_initialize
self.func_process_initialize(self.user_context)
File "user_code.py", line 328, in process_initialize
get_multifactorial(context)
File "user_code.py", line 1886, in get_multifactorial
effect_test_df_T = effect_test(scores_return_panel, g.factors)
File "user_code.py", line 1731, in effect_test
total_return[fac] = (monthly+1).T.cumprod().iloc[-1,:]-1 # 总收益
File "/opt/conda/envs/kuanke/lib/python2.7/site-packages/pandas/core/indexing.py", line 1187, in __getitem__
return self._getitem_tuple(key)
File "/opt/conda/envs/kuanke/lib/python2.7/site-packages/pandas/core/indexing.py", line 1426, in _getitem_tuple
retval = getattr(retval, self.name)._getitem_axis(key, axis=axis)
File "/opt/conda/envs/kuanke/lib/python2.7/site-packages/pandas/core/indexing.py", line 1480, in _getitem_axis
return self._get_loc(key, axis=axis)
File "/opt/conda/envs/kuanke/lib/python2.7/site-packages/pandas/core/indexing.py", line 89, in _get_loc
return self.obj._ixs(key, axis=axis)
File "/opt/conda/envs/kuanke/lib/python2.7/site-packages/pandas/core/frame.py", line 1719, in _ixs
label = self.index[i]
File "/opt/conda/envs/kuanke/lib/python2.7/site-packages/pandas/tseries/base.py", line 75, in __getitem__
val = getitem(key)
IndexError: index -1 is out of bounds for axis 0 with size 0
1、yearBefore = today-timedelta(days=1000) # 前面12年;
2、# 每月回报
filename = "values_return_dict_history_20170622.pkl"。
研究的结果:
开始时间 2017-07-15 12:03:25
start: 2014-10-19
end: 2017-07-15
[]
序列化保存对象:values_return_dict_history
score_df= all
C NaN
CC NaN
CMC NaN
CMC/C NaN
CRF/MC NaN
EPS NaN
GPM NaN
INPA NaN
INPYOY NaN
IRA NaN
IRYOY NaN
MC NaN
NP/MC NaN
NPM NaN
OP/MC NaN
OPTTR NaN
OR*ROA/NP NaN
OR/MC NaN
PB NaN
PE NaN
PR NaN
PRL NaN
PS NaN
ROA NaN
ROE NaN
ROIC NaN
RP/MC NaN
TA/MC NaN
TCA/TCL NaN
TL/TA NaN
TOE/MC NaN
TP/MC NaN
ZYZY NaN
本次因子: resultFac C False
CC False
CMC False
Name: ascending, dtype: bool
结束时间 2017-07-15 12:03:31
所用时间(秒) 5.98364114761
所用时间(分) 0.0997273524602
所用时间(时) 0.001662122541
###############################3
吧时间推荐2000天,3000天都是空值。我怀疑我622文件是不是传上来的是空文件?