通达信布林主图指标公式源码
{参数设置:N(2,300;20)};
M1:=((EMA(C,12)-EMA(C,26))/EMA(C,12)+1)*N,NODRAW;
DIF:=MA(((EMA(C,12)-EMA(C,26))/EMA(C,12)+1)*C,M1);
M:EMA("KDJ.K"(9,3,3)/100+"KDJ.D"(9,3,3)/100,N)*N,NODRAW;
M_A:=SUM(C,M)/SUM(1,M);{此式有利看新股}
{M_A:=MA(C,N);备用,当上市交易日数>=N时与上式等值};
CQ:=ABS(C);
SD1:=SQRT(SUM((C-M_A)*(C-M_A)*CQ/SUM(CQ,M),M));
SD2:=SQRT(SUM((C-M_A)*(C-M_A)*CQ,M)/SUM(CQ,M));
SD:=(SD1+SD2)/2;{其实SD1、SD2无原理性区别,但有个截尾误差}
顶线:M_A+2*SD;
强线:M_A+SD;
中线:M_A,LINETHICK1;
弱线:M_A-SD;
底线:M_A-2*SD;