Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventAnalyzer报错 #56

Open
slashqiang opened this issue Aug 21, 2018 · 0 comments
Open

EventAnalyzer报错 #56

slashqiang opened this issue Aug 21, 2018 · 0 comments

Comments

@slashqiang
Copy link

当分析日内交易记录(即同一天有买卖)时,会报错如下。

如:trade.csv文件如下
index,commission,entrust_action,entrust_no,fill_date,fill_no,fill_price,fill_size,fill_time,symbol,task_id,trade_date
0,0.3027,Buy,1,20170614,1,3027.0,1.0,134800,rb1710.SHF,201706140003,20170614
1,0.3073,Sell,2,20170614,2,3073.0,1.0,145700,rb1710.SHF,201706140004,20170614

运行 do_analyze(result_dir=result_dir_path, selected_sec=props['symbol'].split(','))
报错如下:
Traceback (most recent call last):

File "", line 1, in
analyze()

File "", line 214, in analyze
ta.do_analyze(result_dir=result_dir_path, selected_sec=props['symbol'].split(','))

File "/xxx/jaqs/trade/analyze/analyze.py", line 760, in do_analyze
self.get_returns(compound_return = compound_rtn, consider_commission=True)

File "/xxx/jaqs/trade/analyze/analyze.py", line 586, in get_returns
max_dd_start = np.argmax(active_cum[:max_dd_end]) # start of period

File "/xxx/numpy/core/fromnumeric.py", line 1004, in argmax
return _wrapfunc(a, 'argmax', axis=axis, out=out)

File "/xxx/numpy/core/fromnumeric.py", line 52, in _wrapfunc
return getattr(obj, method)(*args, **kwds)

ValueError: attempt to get argmax of an empty sequence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant