相关简介:通达信布林线主图(多空)指标公式源码分享
通达信指标公式源码概况:
指标类别:通达信指标公式
授权方式:免费版
指标评级:★★★★★
指标分类:策略
画线方法:副图
指标说明:
本指标是
由传统布林指标优化而来。
默认参数是20,2。布林中轨也是20日。
中轨会变色,中轨向上时粉色,代表上涨。
中轨向下时,显示绿色,代表下跌趋势。
中轨粉色绿色频繁变化,向上向下频繁变化,代表震荡趋势。
增加高亮,增加5日线。
柱实心红=涨停K线
绿色K线柱=跌停板K线
法则:
中轨线和蓝色虚线两根线作为买卖参考:
股价站稳下边线试探买,股价向上上边线试探加仓,股价向下突破上边线减去加的仓,股价向下跌破下边线清仓。
这种买卖发法则可以规避拿不住的遗憾,也克服了不会止损的风险。
严格执行这条买卖纪律,就会赢了。
中轨说明:
1、布林线中轨代表股票的趋势,横盘和下降趋势都不做,只做上升趋势,并且是比较强势的上趋势,中轨线白变红,趋势形成。
2、时候中轨线走平就可以关注,回落逢低买就可了。
3、中轨上是强势区,做股票的主战场。中轨下是弱势区域,一般不参与,。
布林线指标买卖规则:
1、三条轨道线同向上行为买入信号。
2、三条轨道线同时下行为卖出信号。
3、上、中线上行,下轨下行,可半仓买入。
4、上轨上行,中下轨下行,向下突破深度调整。
5、上中下平行运行,横盘整理或箱体震荡。
公式解读:
DRAWGBK(CLOSE 0,STRIP(RGB(100,150,200),RGB(30,20,0),1));
K5:EMA(CLOSE,5),colorred,LINETHICK0,PRECIS2;
K10:EMA(CLOSE,10),LINETHICK0,PRECIS2;
k20:EMA(CLOSE,20),LINETHICK0,PRECIS2;
K30:=EMA(CLOSE,30);
k25:=EMA(CLOSE,25);
PARTLINE(K5,K5 REF(K5,1),RGB(255,0,0),K5 REF(K5,1),RGB(0,255,0),1),LAYER0;
PARTLINE(K10,K10 REF(K10,1),RGB(255,0,0),K10 REF(K10,1),RGB(0,255,0),1),linethick2,LAYER0;
PARTLINE(k20,k20 REF(k20,1),RGB(155,55,0),k20 REF(k20,1),RGB(0,255,250),1),LAYER0;
PARTLINE(k25,k25 REF(k25,1),RGB(155,55,0),k25 REF(k25,1),RGB(0,255,250),1),LAYER0;
PARTLINE(K30,K30 REF(K30,1),RGB(155,55,0),K30 REF(K30,1),RGB(0,255,250),1),LAYER0;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE REF(CLOSE,1),LOW,HIGH,0.1,0),colorred;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE REF(CLOSE,1),OPEN,CLOSE,7,0),colorred;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE =REF(CLOSE,1),LOW,HIGH,0.1,0),colorcyan;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE =REF(CLOSE,1),OPEN,CLOSE,7,0),colorcyan;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,0,0),COLOR00FF00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,8,0),COLOR008800;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,6,0),COLOR00AA00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,3,0),COLOR00DD00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,2,0),COLOR00EE00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,1,0),COLOR00FF00;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,0,0),COLORFFBBFF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,8,0),COLORFF00FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,6,0),COLORFF44FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,3,0),COLORFF99FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,2,0),COLORFFAAFF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,1,0),COLORFFBBFF;
BBI:(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,coloryellow,POINTDOT,LINETHICK2;
多:BBI+3*STD(BBI,10),coloryellow,POINTDOT,LINETHICK1;
空:BBI-3*STD(BBI,10),coloryellow,POINTDOT,LINETHICK1;
a1:=EMA(CLOSE,3);
a2:=EMA(CLOSE,46);
a3:=(a1-a2)*3;
a4:=EMA(a3,5);
DRAWTEXT(a4 REF(a4,1),K30,'o'),COLORff0000;
DRAWTEXT(a4 =REF(a4,1),K30,'o'),COLOR0000FF;
追:DRAWTEXT(CROSS(A1,A2),L*0.98,'追'),COLOR0000FF;
逃:DRAWTEXT(CROSS(A2,A1),H*1.02,'逃'),COLOR0000FF;
SS:=MA(C,30) REF(MA(C,30),1);SS1:=MA(C,20) REF(MA(C,20),1);ADS:=
MA(C,10) REF(MA(C,10),1);
VAR1:=CLOSE REF(CLOSE,1)AND
CLOSE REF(CLOSE,2);
VAR2:=REF(VAR1,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR3:=REF(VAR2,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR4:=REF(VAR3,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR5:=REF(VAR4,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR6:=REF(VAR5,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR7:=REF(VAR6,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR8:=REF(VAR7,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR9:=REF(VAR8,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VARA:=REF(VAR9,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VARB:=REF(VARA,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VARC:=REF(VARB,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
涨:=STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5OR
VAR6OR
VAR7ORVAR8ORVAR9ORVARAORVARBOR
VARC,CLOSE,OPEN,5,1),COLORRED;
VARD:=CLOSE REF(CLOSE,1)AND
CLOSE REF(CLOSE,2);
VARE:=REF(VARD,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VARF:=REF(VARE,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR10:=REF(VARF,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR11:=REF(VAR10,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR12:=REF(VAR11,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR13:=REF(VAR12,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR14:=REF(VAR13,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR15:=REF(VAR14,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR16:=REF(VAR15,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR17:=REF(VAR16,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
VAR18:=REF(VAR17,1)ANDCLOSE =REF(CLOSE,1)AND
CLOSE =REF(CLOSE,2);
跌:=STICKLINE(VARDORVAREORVARFORVAR10ORVAR11
ORVAR12ORVAR13OR
VAR14ORVAR15ORVAR16ORVAR17OR
VAR18,CLOSE,OPEN,5,1),COLORBLUE;
VAR19:=REF(VARDORVAREORVARFORVAR10OR
VAR11ORVAR12ORVAR13ORVAR14ORVAR15ORVAR16ORVAR17ORVAR18,1)AND
VAR1;
底:=STICKLINE(VAR19,LOW,OPEN,6,0),COLORYELLOW;
VAR1A:=REF(VAR1OR
VAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7ORVAR8ORVAR9ORVARAORVARBOR
VARC,1)AND
VARD;
AAA:=(MA(CLOSE,13)+MA(CLOSE,17))/2;CCC:=(STD(CLOSE,13)+STD(CLOSE,17))/2;
BBB:=AAA+2.1*CCC;DDD:=AAA+0.72*CCC;ZZZ:=IF(CCC 1.88,MA(DDD,3),DDD);
平衡:ZZZ,LINETHICK2;止赢:=ZZZ*1.1;了结:=ZZZ*1.05;回档:=ZZZ*0.95;反弹:=ZZZ*0.9;
DRAWTEXT(L =反弹ANDC OAND
C 反弹,L*0.98,'买!'),COLORYELLOW;
DRAWTEXT(L =止赢ANDH =止赢ANDC O
AND
(REF(C,1)-C)/C 0.02,H*1.02,'W R'),COLORGREEN;
BOLL:=MA(CLOSE,20);上轨:BOLL+2*STD(CLOSE,20),COLORA08888,LINETHICK2;
下轨:BOLL-2*STD(CLOSE,20),COLORA08888;DIFF:=EMA(CLOSE,12)
-
EMA(CLOSE,26);
DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B11:=REF(C,A11+1) C
ANDREF(DIFF,A11+1) DIFFAND
CROSS(DIFF,DEA);
DRAWTEXT(B11 0,L*0.90,'M买'),COLORGREEN;C11:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C11+1) C
ANDREF(DIFF,C11+1) DIFFAND
CROSS(DEA,DIFF);
DRAWTEXT(D1 0,H*1.07,'M卖'),COLOR0066FF;N1:=10;P1:=3;
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
上:=BBI+P1*STD(BBI,N1);险:=IF(BBI*1.15 上*1.03,上*1.06,上*1.03);
下:=BBI-P1*STD(BBI,N1);中:=BBI;AA:=BBI+P1*STD(BBI,N1)/2;BB:=BBI-P1*STD(BBI,N1)/2;
MA30:=MA(C,30);QSXS1:=AA REF(AA,1)
ANDBBI REF(BBI,1);QSXS2:=COUNT(MA30 REF(MA30,1),5)=5;
FLSZ:=C OAND
V REF(V,1);RMG:=FLSZAND(C/REF(C,1)-1)*100
SCAA:=CROSS(C,AA)OR
(O AAAND
C BLK:=LLV((上-下),2)=LLV((上-下),10);
XBLK:=(上/下-1)*100 BLKSJ:=BARSLAST(BLK)+1;
拉升:=FILTER(SCAA
ANDFLSZAND(QSXS1OR(QSXS2AND
BLKSJ 5)),3),COLORFF00FF,POINTDOT,LINETHICK0;
优选:=拉升AND
COUNT(XBLK,4) =1AND
RMG,COLOR00FF00,POINTDOT,LINETHICK0;
高:=((H/BBI-1)*100 =15
AND(H/上-1)*100 =3)OR
(H/上-1)*100
DRAWTEXT(高,H*1.00,'▼'),COLOR00FFFF;DRAWTEXT(高,H*1.002,' ̄'),COLOR00FFFF;
dc0:=max(0.01*amount/v,max(c,o));
dc1:ma(dc0,5),COLORFFC010,LAYER7;
dc2:ema(dc1,3),COLORFFC010,LAYER7;
dc3:ema(dc2,3),COLORFFC010,LAYER7;
dc4:ema(dc3,3),COLORFFC010,LAYER7;
dc5:ema(dc4,3),COLORFFC010,LAYER7;
dc6:ema(dc5,3),COLORFFC010,LAYER7;
dc7:ema(dc6,3),COLORFFC010,LAYER7;
dc8:ema(dc7,3),Colorred,linethick2,LAYER7;