Skip to content

Commit

Permalink
Merge pull request #188 from fasiondog/feature/analysis
Browse files Browse the repository at this point in the history
fixed sys_performance 除0
  • Loading branch information
fasiondog committed Mar 5, 2024
2 parents 568f756 + a688b51 commit a0844ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hikyuu/draw/drawplot/matplotlib_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def sys_performance(sys, ref_stk=None):
bond = ZHBOND10(ref_dates)
sigma = STDEV(ROCP(funds), len(ref_dates))
sigma = 15.874507866387544 * sigma[-1] # 15.874 = sqrt(252)
sharp = (per['帐户平均年收益率%'] - bond[-1]) * 0.01 / sigma
sharp = (per['帐户平均年收益率%'] - bond[-1]) * 0.01 / sigma if sigma != 0.0 else 0.0
invest_total = per['累计投入本金'] + per['累计投入资产']
cur_fund = per['当前总资产']
Expand Down

0 comments on commit a0844ff

Please sign in to comment.