布林macd主图如何改成通达信的
2019/12/16 18:40:17
公式编写说明:
源码: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)) AND MACD>0 and MA13>MID,2),LAYER0,COLOR00FFff;PARTLINE(UPPER ,UPPER and MACD>0,rgb(255,120,0)),LINETHICK3,LAYER0;PARTLINE(MID ,MID and MACD>0,rgb(0,255,0)),LINETHICK3,LAYER0;PARTLINE(MA13 ,MA13 and MACD>0,rgb(255,255,0)),LINETHICK3,LAYER0;PK:=CROSS(0,MACD) AND MACD<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;
公式源码回答:
N:=26;P:=2;
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;
DIFF:=EMA( EMA(CLOSE,12) - EMA(CLOSE,26),3),COLOR0000FF;
DEA:=EMA(DIFF,9),COLOR00FF00;
MACD:=2*(DIFF-DEA),COLORMAGENTA;
X1:=CONST(LLV(L,200)*1.1-LLV(L,200)/1.1)/CONST(HHV(DIFF,200)-LLV(DIFF,200));
X2:=CONST(LLV(L,200)/1.05);
STICKLINE(MACD>0,LLV(L,200)/1.1,CONST(HHV(H,200)),5,0),COLOR8F0059;
STICKLINE(MACD>0,X2+MACD*X1,X2,8,0),COLOR0000FF;
STICKLINE(MACD<0,X2+MACD*X1,X2,0,0),COLOR00FF00;
NOTEXT1:IF(MACD>0,UPPER,DRAWNULL),COLOR0078FF,LINETHICK3;
NOTEXT2:IF(MACD>0,MID,DRAWNULL),COLORYELLOW,LINETHICK3;
NOTEXT3:IF(MACD>0,MA13,DRAWNULL),COLORGREEN,LINETHICK3;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
PK:=CROSS(0,MACD);
DRAWTEXT(PK,LOWER*0.999,' ●'),COLOR0000FF;
DRAWTEXT(PK,LOWER*0.96,'【别】'),COLOR00FFFF;
DRAWTEXT(PK,LOWER*0.92,'【坐】'),COLOR00FFCC;
DRAWTEXT(PK,LOWER*0.88,'【过】'),COLOR00FFAA;
DRAWTEXT(PK,LOWER*0.84,'【山】'),COLOR00FF77;
DRAWTEXT(PK,LOWER*0.80,'【车】'),COLOR00FF00;
投股票 网 www.tou18.c n
股市公式下载推荐