请问大佬,代码块”加入反转“中关于评分的减项目”200天年化收益率*R方/6“除以6是什么原因,或者怎么考虑的呢?谢谢,感谢回复。
#加入200天反转
df2 = attribute_history(etf, g.m_days*8, '1d', ['close'])
y2= df2['log'] = np.log(df2.close)
x2 = df2['num'] = np.arange(df2.log.size)
slope2, intercept2 = np.polyfit(x2, y2, 1)
annualized_returns2 = math.pow(math.exp(slope2), 250) - 1
r_squared2 = 1 - (sum((y2 - (slope2 * x2 + intercept2))**2) / ((len(y2) - 1) * np.var(y2, ddof=1)))
score= score - annualized_returns2 * r_squared2 / 6
2023-09-18