相关简介:    boll指标公式大全                              

     通达信指标公式源码概况:

  指标类别:通达信指标公式

  授权方式:免费版

  指标评级:★★★★★

  指标分类:策略

  画线方法:副图

指标不是万能的,到处找指标,不如就用系统自带的指标,稍微组合,就是一个很好的指标.这是一个用
7MA和BOLL组合的主图指标,简明扼要,具有很高的实战价值.大家可以试试.请看

通达信指标公式源码:

   
    {BOLL金主图指标公式}
    
    {1.重心线}
    HH:=HHV(H,3);LL:=LLV(L,3);
    ZXC:=WMA((2*C+HH+LL)/4,4);
    ZXO:=REF(ZXC,1);
    ZXC,COLOR00FF00,LINETHICK2;
    IF(ZXC>REF(ZXC,1),ZXC,DRAWNULL),COLORRED,LINETHICK3;
    {2.重心k线--------可以加减大括弧-------}
    STICKLINE(ZXO>=ZXC,ZXO,ZXC,3,0),COLOR003300;
    STICKLINE(ZXO>=ZXC,ZXO,ZXC,2,0),COLOR005500;
    STICKLINE(ZXO>=ZXC,ZXO,ZXC,1,0),COLOR007700;
    STICKLINE(ZXO>=ZXC,ZXO,ZXC,0.5,0),COLOR009900;
    STICKLINE(ZXO<ZXC,ZXO,ZXC,3,0),COLOR0099FF;
    STICKLINE(ZXO<ZXC,ZXO,ZXC,2,0),COLOR0077FF;
    STICKLINE(ZXO<ZXC,ZXO,ZXC,1,0),COLOR0055FF;
    STICKLINE(ZXO<ZXC,ZXO,ZXC,0.5,0),COLOR0033FF;
    {3.BOLL-金}
    MID:MA(ZXC,18),COLOR00FFFF,DOTLINE;
    UPPER:MID+1.8*STD(ZXC,18),COLORFF66FF;
    LOWER:MID-1.8*STD(ZXC,18),COLORFF9900;
    {4.高抛.低吸}
    RC:=(H+L+C*2)/4;
    R2D:=WMA(RC,27);
    R2E:=STD(RC,27);
    R3F:=(RC-R2D)/R2E*100;
    R40:=WMA(R3F,3);
    R41:=WMA(R40,3);
    JD:=WMA(R41,2);
    AJ:=3*R41-2*JD;
    DRAWTEXT(CROSS(AJ,JD),L-0.2,'←买呗'),COLOR00FFFF,LINETHICK2;
    DRAWTEXT(CROSS(JD,AJ),H+0.2,'←跑哇'),COLOR00FFFF,LINETHICK2;
    
    {KDJ+BOLL指标公式}
    
    N:=9;M1:=3;M2:=3;
    RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
    K:SMA(RSV,M1,1);
    D:SMA(K,M2,1);
    J:3*K-2*D;
    BOLL:MA(J,20),LINETHICK3;
    UPPER:BOLL+2*STD(J,20);
    LOWER:BOLL-2*STD(J,20);
    IF(J>REF(J,1),J,DRAWNULL),COLORRED,LINETHICK2;
    IF(J<REF(J,1),J,DRAWNULL)COLOR00BB00,LINETHICK2;
    
    {BOLL成交量指标公式}
    
    VOL,VOLSTICK;
    STICKLINE(V>=3*REF(V,1),V/3,V/2.5,3.9,0),COLORWHITE;
    STICKLINE(V>=2*REF(V,1),V/2,V/1.7,3.9,0),COLORYELLOW;
    流通〖亿〗:CAPITAL/1000000,LINETHICK0;
    内外比:DYNAINFO(51),COLORYELLOW,LINETHICK0;
    单日量比:V/REF(V,1),COLORWHITE,LINETHICK0;
    五日量比:V/(REF(MA(V,5),1)/240),COLORYELLOW,LINETHICK0;
    5换:SUM(100*V/CAPITAL,5),LINETHICK0;
    10换:SUM(100*V/CAPITAL,10),LINETHICK0;
    20换:SUM(100*V/CAPITAL,20),LINETHICK0;
    H1:=VOL<REF(LLV(VOL,13),1);
    H2:=VOL<REF(LLV(VOL,55),1);
    STICKLINE(H1,0,V,1.5,0),COLORBLUE;
    STICKLINE(H2,0,V,1.5,0),COLORMAGENTA;
    量能突变:V+REF(V,1)>=(REF(V,2)+REF(V,3)+REF(V,4)+REF(V,5)+REF(V,6))/5*3ANDV<2*REF(V,1)ANDC>OANDC>MA(C,21),COLORGREEN;
    STICKLINE(量能突变,2*V/3,V,3,0),COLORFF00FF;
    量价配合:REF(V,1)<MAX(MA(V,5),MAX(MA(V,10),MA(V,20)))ANDV>MAX(MA(V,5),MAX(MA(V,10),MA(V,20)))ANDV<2*REF(V,1)ANDCROSS(C,MA(C,21));
    STICKLINE(量价配合,V/3,2*V/3,3,1),LINETHICK5;
    量价突破:C>=HHV(C,15)ANDV>=HHV(V,15),COLORGREEN;
    STICKLINE(量价突破,0,V/3,2,0),COLORGREEN;
    T1:=COUNT(V>REF(V,1)*2,4)=1;
    T2:=COUNT(V<REF(V,1)ANDL>MIN(L,4)ANDL>REF(L,1),3)=3;
    T3:T1ANDT2;
    倍量:V/REF(V,1)>=2ANDC-REF(C,1)>0;
    DRAWTEXT(倍量,H,'倍'),COLORYELLOW;
    缩倍量:V/REF(V,1)<=0.5;
    DRAWTEXT(缩倍量,L,'半'),COLORYELLOW;
    连跌:LAST(V<REF(V,1),2,1);
    STICKLINE(倍量,0,VOL,1.8,0),COLORYELLOW;
    STICKLINE(缩倍量,0,VOL/2,2,0),COLORWHITE;
    {20日量布林线}
    MID:MA(VOL,20),COLORWHITE;
    饱和:MID+2*STDP(V,20),COLORYELLOW;
    LLW:=MID-2*STDP(V,20);
    {支撑阻力BOLL主图指标}
    源码
    N:=26;P:=2;
    支撑:CLOSE-(AMOUNT/VOL/100-LOW);
    阻力:CLOSE+(AMOUNT/VOL/100-LOW);
    MID: MA(CLOSE,N);
    UPPER:MID+P*STD(CLOSE,N);
    LOWER:MID-P*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;
    
    {BOLL指标公式}
    
    上A:2.1*stD(C,20)/ma(C,20)*1000;
    下A:-2.1*STD(C,20)/MA(C,20)*1000;
    上B:1.3*STD(C,20)/MA(C,20)*1000;
    下B:-1.3*STD(C,20)/MA(C,20)*1000;
    开:=(O/MA(C,20)-1)*1000;
    高:=(H/MA(C,20)-1)*1000;
    低:=(L/MA(C,20)-1)*1000;
    收:=(C/MA(C,20)-1)*1000;
    STICKLINE(C,0,0,6,0),COLORYELLOW;
    STICKLINE(收>=开,高,低,0,0),COLORRED;
    STICKLINE(收>=开,收,开,2,0),COLORRED;
    STICKLINE(收<开,高,低,0,0),COLORGREEN;
    STICKLINE(收<开,收,开,2,0),COLORGREEN;
    MID:=MA(CLOSE,26);
    AB:=EMA((EMA(CLOSE,3)+EMA(CLOSE,5)+EMA(CLOSE,8)+EMA(CLOSE,13))/4,2)LINETHICK2;
    UPPER:=IF(DATE<1090501,MID+2*STD(CLOSE,26),0);
    AUPPER:=IF(DATE<1090501,MID+1.7*2*STD(CLOSE,26),0);
    LOWER:=IF(DATE<1090501,MID-2*STD(CLOSE,26),0);
    ALOWER:=IF(DATE<1090501,MID-1.7*2*STD(CLOSE,26),0);
    DRAWTEXT(crOSS(AB,MID),0,'追击');
    
    {BOLL至主图指标公式}
    
    {使用说明:突破买进,以高轨道控盘,不进入高轨道内不卖,进入轨道内就卖。布林高轨道上方,收盘不进入高轨道内不卖。}
    MID:ma(CLOSE,20),LINETHICK2;
    UPPER:MID+1.2*stD(CLOSE,20),LINETHICK2;
    LOWER:MID-1.2*STD(CLOSE,20),LINETHICK2;
    MA63:MA(C,60);
    
    {BOLL必杀技主图指标公式}
    
    {使用说明:在主升浪启动时,该必杀技指标在k线上的表现为开口不断扩大,红线五日线作为k线的支撑不断往上走。每次回踩红色线一般不会超过一到两根阴线,最多不会超出三连阴线。}
    N:=20;
    MID:=ma(C,N);
    VART1:=POW((C-MID),2);
    VART2:=MA(VART1,N);
    VART3:=SQRT(VART2);
    UPPER:=MID+2*VART3;
    LOWER:=MID-2*VART3;
    boll:REF(MID,1),COLORFFFFFF;
    上升:IF(BOLL>REF(BOLL,1),BOLL,DRAWNULL),COLORRED,LINETHICK1;
    下降:IF(BOLL<REF(BOLL,1),BOLL,DRAWNULL),COLORGREEN,LINETHICK1;
    UB:REF(UPPER,1),COLOR00FFFF;
    LB:REF(LOWER,1),COLORFF00FF;
    
    {跟庄BOLL主图指标公式}
    
    M:=20;
    N:=4;
    boll:ma(CLOSE,M);
    UB:BOLL+2*stD(CLOSE,M);
    LB:BOLL-2*STD(CLOSE,M);
    高:=REF(HHV(H,72),5);
    龙门:REFDATE(高,DATE),COLORWHITE,LINETHICK2;
    TM:=1200823;
    涨停:IF(DATE<TM,ZTPRICE(REF(C,1),IF(CODELIKE('688'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1))),ZTPRICE(REF(C,1),IF(CODELIKE('688')ORCODELIKE('300'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1)))),NODRAW,COLORRED;
    跌停:IF(DATE<TM,DTPRICE(REF(C,1),IF(CODELIKE('688'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1))),DTPRICE(REF(C,1),IF(CODELIKE('688')ORCODELIKE('300'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1)))),NODRAW,COLORGREEN;
    明涨停:IF(DATE<TM,C*IF(CODELIKE('688'),1.2,IF(NAMEINCLUDE('S'),1.05,1.1)),C*(IF(CODELIKE('688')ORCODELIKE('300'),1.2,IF(NAMEINCLUDE('S'),1.05,1.1)))),NODRAW,COLORLIMAGENTA;
    明跌停:IF(DATE<TM,C*IF(CODELIKE('688'),0.8,IF(NAMEINCLUDE('S'),0.45,0.9)),C*(IF(CODELIKE('688')ORCODELIKE('300'),0.8,IF(NAMEINCLUDE('S'),0.45,0.9)))),NODRAW,COLORFFFF00;
    ZT:=C>=涨停ANDPERIOD=5ANDH=C;
    ZT1:=H>=涨停ANDPERIOD=5ANDH>C;
    DT:=C<=跌停ANDPERIOD=5ANDL=C;
    DT1:=L<=跌停ANDPERIOD=5ANDL<C;
    {涨停k线颜色设置}
    STICKLINE(ZT,C,(O+C)/2,3,0),COLOR000099;
    STICKLINE(ZT,C,(O+C)/2,2.2,0),COLOR0000CC;
    STICKLINE(ZT,C,(O+C)/2,1.5,0),COLOR0000FF;
    STICKLINE(ZT,C,(O+C)/2,0.5,0),COLORCC66FF;
    STICKLINE(ZT,O,(O+C)/2,3,0),COLOR999999;
    STICKLINE(ZT,O,(O+C)/2,2.2,0),COLORBBBBBB;
    STICKLINE(ZT,O,(O+C)/2,1.5,0),COLORDDDDDD;
    STICKLINE(ZT,O,(O+C)/2,0.5,0),COLORFFFFFF;
    STICKLINE(DT,O,(O+C)/2,3,0),COLOR999999;
    STICKLINE(DT,O,(O+C)/2,2.2,0),COLORBBBBBB;
    STICKLINE(DT,O,(O+C)/2,1.5,0),COLORDDDDDD;
    STICKLINE(DT,O,(O+C)/2,0.5,0),COLORFFFFFF;
    STICKLINE(DT,C,(O+C)/2,3,0),COLOR009900;
    STICKLINE(DT,C,(O+C)/2,2.2,0),COLOR00BB00;
    STICKLINE(DT,C,(O+C)/2,1.5,0),COLOR00DD00;
    STICKLINE(DT,C,(O+C)/2,0.5,0),COLOR00FF00;
    {曾涨跌停打开K线颜色设置}
    STICKLINE(ZT1,C,(O+C)/2,3,0),COLORFF00FF;
    STICKLINE(ZT1,C,(O+C)/2,2.2,0),COLORFF00FF;
    STICKLINE(ZT1,C,(O+C)/2,1.5,0),COLOR0000FF;
    STICKLINE(ZT1,O,(O+C)/2,3,0),COLOR999999;
    STICKLINE(ZT1,O,(O+C)/2,2.2,0),COLORBBBBBB;
    STICKLINE(ZT1,O,(O+C)/2,1.5,0),COLORDDDDDD;
    STICKLINE(DT1,O,(O+C)/2,3,0),COLOR888888;
    STICKLINE(DT1,O,(O+C)/2,2.2,0),COLORBBBBBB;
    STICKLINE(DT1,O,(O+C)/2,1.5,0),COLORDDDDDD;
    STICKLINE(DT1,C,(O+C)/2,3,0),COLOR009900;
    STICKLINE(DT1,C,(O+C)/2,2.2,0),COLOR00BB00;
    STICKLINE(DT1,C,(O+C)/2,1.5,0),COLOR00DD00;
    STICKLINE(DT1,C,(O+C)/2,0.5,0),COLOR00FF00;
    DRAWTEXT(ZTANDDT1ANDPERIOD=5,L-0.03,'地天板'),COLORCC00CC;{从跌停到涨停}
    DRAWTEXT(DTANDZT1ANDPERIOD=5,H+0.03,'天地板'),COLOR00CC00;{从涨停到跌停};
    DRAWTEXT(DT1,L-0.09,'撬'),COLORCC00CC;{从涨停到跌停};
    DRAWTEXT(ZT1,H+0.03,'炸'),COLOR00CC00;{从涨停到跌停};
    假阴:=REF(C>=O,1)ANDAMOUNT/V/100>REF(C,1)ANDC<O;
    假阳:=REF(C<=O,1)ANDH<REF(O,1)ANDC<(REF(O-C,1))/3+REF(C,1)ANDAMOUNT/V/100<REF(C,1)ANDC>O;
    STICKLINE(假阴,O,C,0.2,0),COLORRED;{假阴柱};
    STICKLINE(假阳,O,C,0.7,0),COLORLIGREEN;{假阳};
    JJ:=(C+H+L)/3;
    A:=EMA(JJ,10);
    B:=REF(A,1);
    STICKLINE(A>B,A,B,2,0),COLORYELLOW;
    STICKLINE(A<B,A,B,2,0),COLORBLUE;
    月线:=WMA(C,21);
    月角:=ATAN((月线/REF(月线,1)-1)*100)*180/3.1416,NODRAW;
    A1:=REF(H,N)=HHV(H,2*N+1);
    B1:=FILTER(A1,N);
    C1:=BacKSET(B1,N+1);
    D1:=FILTER(C1,N)ANDZT;
    E1:=BArslAST(D1);
    STICKLINE(D1,BOLL,UB,2,0),COLORRED;
    GX:=(O<LBANDC>LB)OR(O<BOLLANDC>BOLL)OR(O<UBANDC>UB);
    缩量:=V<0.8*HHV(V,20);{量小于20天内最高量的0.8倍}
    选股:=crOSS(C,REF(H,E1))ANDGXANDV<=REF(V,E1)*1.2AND月角>30,NODRAW;
    STICKLINE(选股,LB,BOLL,0.1,0),COLORGREEN;
    STICKLINE(选股,UB,BOLL,0.1,0),COLORRED;
    市值:(FINANCE(40)/100000000),NODRAW,COLORRED;
    股东占流通比:100*FINVALUE(244)/FINVALUE(239),NODRAW;
    历史衰退系数:100/(100-股东占流通比),NODRAW;
    {板块排名}
    TAX:=HORCALC(HYBLOCK,105,1,DRAWNULL);
    TAA:=STRCAT(HYBLOCK,'排名:');
    DRAWTEXT_FIX(ISLASTBAR,0.70,0.005,0,STRCAT(TAA,CON2STR(TAX,0)));
    
    {优化boll主图指标公式}
    
    DX:=(C+H+L+O)/4;
    mtm:=C-REF(C,1);
    ZLGJ:=100*Ema(EMA(MTM,6),6)/EMA(EMA(Abs(MTM),6),6);
    FB:=MA(DX,17)+ABS(MA(DX,17)-REF(MA(DX,17),1));
    FS:=MA(DX,17)+MA(DX,17)-REF(MA(DX,17),1);
    买1:=IF(LLV(ZLGJ,2)=LLV(ZLGJ,7)ANDCOUNT(ZLGJ<0,2)ANDcrOSS(ZLGJ,MA(ZLGJ,2)),1,0);
    卖1:=IF(HHV(ZLGJ,2)=HHV(ZLGJ,7)ANDCOUNT(ZLGJ>50,2)ANDCROSS(MA(ZLGJ,2),ZLGJ),1,0);
    stICKLINE(FILTER(买1=1,5),C,O,6,0),COLORFF00FF;
    STICKLINE(FILTER(卖1=1,1),C,O,6,0),COLOR00FF00;
    RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
    A:=(3*C+L+O+H)/6;
    BB:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
    +13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
    +7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
    REF(A,20))/210;
    MA101:=MA(CLOSE,10);
    周MA101:MA(MA101,5),COLORRED,LINETHICK2;
    上翘:IF(周MA101>REF(周MA101,1),周MA101,DRAWNULL),COLORRED,LINETHICK4;
    下拐:IF(周MA101<REF(周MA101,1),周MA101,DRAWNULL),COLORGRAY,LINETHICK4;
    boll:MA(CLOSE,20);
    UPPER:BOLL+2*STD(CLOSE,20);
    LOWER:BOLL-2*STD(CLOSE,20);
    
    
    {BOLL+MACD主图指标公式}
    input:n(26,5,300),p(2,0.1,10);
    MA13:MA(C,13),COLORFF9900,DOTLINE;
    MID:MA(CLOSE,N),DOTLINE;
    UPPER:MID+P*STD(CLOSE,N),DOTLINE;
    LOWER:MID-P*STD(CLOSE,N),DOTLINE;
    X:=BARSLAST(DISPSTATUS=1)+1;
    E:=llvall(llv(l,x))*0.95;
    DIFF:EMA(EMA(CLOSE,12)-EMA(CLOSE,26),3),COLOR0000FF,LINETHICK0;
    DEA:EMA(DIFF,9),COLOR00FF00,LINETHICK0;
    MACD:2*(DIFF-DEA),LINETHICK0;
    STICKLINE(MACD>0,E+MACD*3,E,18,0),Color0000FF;
    STICKLINE(MACD<0,E+MACD,E,1,0),Color00FF00;
    DRAWGBK(MACD>0,STRIP(RGB(0,0,255),RGB(140,0,80),0)),LAYER0;
    VERTLINE(CROSS(REF(WMA(C,13),1),WMA(C,13))ANDMACD>0andMA13>MID,2),LAYER0,COLOR00FFff;
    PARTLINE(UPPER,UPPERandMACD>0,rgb(255,120,0)),LINETHICK3,LAYER0;
    PARTLINE(MID,MIDandMACD>0,rgb(0,255,0)),LINETHICK3,LAYER0;
    PARTLINE(MA13,MA13andMACD>0,rgb(255,255,0)),LINETHICK3,LAYER0;
    PK:=CROSS(0,MACD)ANDMACD<0;
    DRAWTEXT(PK,LOWER*0.999,'●'),LAYER3,ALIGN1,COLOR0000FF,LINETHICK2;
    DRAWTEXT(PK,LOWER*0.981,'【别】'),LAYER0,ALIGN1,COLOR00FFFF,LINETHICK1;
    DRAWTEXT(PK,LOWER*0.963,'【坐】'),LAYER0,ALIGN1,COLOR00FFCC,LINETHICK1;
    DRAWTEXT(PK,LOWER*0.946,'【过】'),LAYER0,ALIGN1,COLOR00FFAA,LINETHICK1;
    DRAWTEXT(PK,LOWER*0.929,'【山】'),LAYER0,ALIGN1,COLOR00FF77,LINETHICK1;
    DRAWTEXT(PK,LOWER*0.912,'【车】'),LAYER0,ALIGN1,COLOR00FF00,LINETHICK1;
    
    
    {钱龙BOLL主图指标公式}
    
     N:=99;
     BOLL1:=MA(CLOSE,N);
     CMSS:=1.96*SQRT(MA(POW((CLOSE-BOLL1),2),N));
     BOLL:BOLL1,COLORFFFFFF;
     UB:BOLL1+CMSS,COLOR00FFFF;
     LB:BOLL1-CMSS,COLORFF00FF;N:=99;
     BOLL1:=MA(CLOSE,N);
     CMSS:=1.96*SQRT(MA(POW((CLOSE-BOLL1),2),N));
     BOLL:BOLL1,COLORFFFFFF;
     UB:BOLL1+CMSS,COLOR00FFFF;
     LB:BOLL1-CMSS,COLORFF00FF;

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。