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

BOLL指标算法错误 #4

Open
lexiaoyao20 opened this issue Jun 30, 2017 · 0 comments
Open

BOLL指标算法错误 #4

lexiaoyao20 opened this issue Jun 30, 2017 · 0 comments
Labels

Comments

@lexiaoyao20
Copy link

日BOLL指标计算为例,
其计算方法如下:
1.日BOLL指标的计算公式
中轨线=N日的移动平均线
上轨线=中轨线+两倍的标准差
下轨线=中轨线-两倍的标准差

2.日BOLL指标的计算过程
(1)计算MA MA=N日内的收盘价之和÷N
(2)计算标准差MD MD=平方根N日的(C-MA)的两次方之和除以N
(3)计算MB、UP、DN线
MB=(N-1)日的MA
UP=MB+2×MD
DN=MB-2×MD

伪代码如下:
中轨:MB=SMA(n-1)=(C1+C2+C3+…+C(n-1))/(n-1))
标准差:MD ={[(C1-SMAn)^2+…+(Cn-SMAn)^2]/n}^0.5
上轨:UP=MB + kMD
下轨:DN=MB - K
MD

根据上面的公式,你的标准差的计算明显有问题。

@herbsun herbsun added the bug label Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants