Skip to content

EventAnalyzer报错 #56

@slashqiang

Description

@slashqiang

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

如: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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions