-
Notifications
You must be signed in to change notification settings - Fork 599
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
SMA函数定义错误 #12
Comments
SMA(S, N, M=1): #中国式的SMA,至少需要120周期才精确 (雪球180周期) alpha=1/(1+com) |
你改过之后的与原来写的无差别,仍然是错误的。 |
纯粹SMA指标不好对比,用主力使用SMA的RSI对比
上面这2个写法得出的结果是一样的 |
return pd.Series(S).ewm(alpha=M/N, adjust=True).mean().values 推导过程如下: 又知道,SMA正确的alpha是M/N 容易求出: 详细验证过程请见: |
感谢,已经修正 |
SMA函数正确的写法应该是:
The text was updated successfully, but these errors were encountered: