//布林線指標(biāo)公式
A:EMA((CLOSE-REF(C,1))/REF(C,1)*10-
(INDEXC-REF(INDEXC,1))/REF(INDEXC,1)*10,5),LINETHICK0,colorred;
STICKLINE(A>0,0,A,1,2),LINETHICK1,colorred;
STICKLINE(A<0,0,A,1,2),LINETHICK2,colorgreen;
HSNP1:=CLOSE-REF(CLOSE,1);
HSNP2:=IF(CLOSE-REF(CLOSE,1)>=0,HSNP1,0);
HSNP3:=REF(CLOSE,1)-CLOSE;
HSNP4:=IF(CLOSE-REF(CLOSE,1)<=0,HSNP3,0);
HSNP5:=SUM(HSNP2,90)/SUM(HSNP4,90);
HSNP6:=100-100/(1+HSNP5);
HSNP7:=EMA(HSNP6,21);
HSNP8:=EMA(HSNP7,5);
HSNP:=EMA(HSNP7,3);
np:= (HSNP7-HSNP),colormagenta,linethick1;
nl:=(HSNP-HSNP7),coloryellow,linethick1;
STICKLINE(nl<0,0,nl,1,2),Color0B0B77;
STICKLINE(np<0,0,np,1,2),COLOR666666;
JJ :=(C*2+H+L)/4;
SK := EMA(JJ,13) - EMA(JJ,21);
SD := EMA(SK,3);
SP := EMA(SK,10);
長線1:IF(SD>=SP,SD,SP),LINETHICK2,colormagenta;
長線2:IF(SP-SD,SP,SD),LINETHICK2,colorwhite;
A1:=EMA(CLOSE,7)-EMA(CLOSE,21);
B1:=EMA((0.668*REF(A1,1)+0.333*A1),1);
做多:IF(A1>=B1,A1,B1),LINETHICK2,colorred;
做空:IF(B1-A1,B1,A1),LINETHICK2,colorgreen;
在該源碼中標(biāo)注了長線的走勢(shì),以及做空做多的走勢(shì)標(biāo)注,目的是在圖形中顯示的時(shí)候?yàn)橥顿Y者提供參考依據(jù),其走勢(shì)在圖中的形態(tài)如下:
其實(shí)在指標(biāo)公式中,還可以對(duì)指標(biāo)的源碼公式進(jìn)行一定的優(yōu)化操作,其基本的源碼優(yōu)化可以是下面的走勢(shì)形態(tài):
//布林線優(yōu)化
n=20;
MB:MA(CLOSE,N);
上軌: MB+STD(CLOSE,N);
下軌: MB-STD(CLOSE,N);
上極限: MB+2*STD(CLOSE,N);
下極限: MB-2*STD(CLOSE,N);
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,9,0 ),COLORaaaaaa;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLORbbbbbb;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2.4,0 ),COLORcccccc;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1.1,0 ),COLORdddddd;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,9,0 ),COLOr6666cc;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6 ,0 ),COLOR7777dd;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.4 ,0 ),COLOR8888ee;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.1 ,0 ),COLOR9999ff;
STICKLINE(CLOSE>OPEN,OPEN,LOW,0.5,0 ),COLOR1199ff;
STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.5 ,0 ),COLOR1199ff;
STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.5 ,0 ),COLORcccccc;
STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.5 ,0 ),COLORcccccc;
其中優(yōu)化的部分是將指標(biāo)的上軌和下軌線以及出現(xiàn)的極限值顯現(xiàn)出來,幫助投資者分析其中的股價(jià)走勢(shì)變化,將其導(dǎo)入到軟件中的走勢(shì)形態(tài)如下:
以上就是本文講解的布林線指標(biāo)的源碼公式以及公式的優(yōu)化操作分析,如果您還想要了解更多的股票公式源碼,請(qǐng)關(guān)注贏家財(cái)富網(wǎng),為您提供更加全面的指標(biāo)公式解析!
服務(wù)中心:鄭州市金水區(qū)農(nóng)業(yè)路經(jīng)三路
郵編:450002 網(wǎng)址:www.xinsheng8.com
銷售熱線:0371-65350319
技術(shù)支持:13333833889