以下是通达信黄金阶梯源码(无源码的请下载附件导入)
DRAWGBK(C>0, RGB(0,0,50),RGB(00,0,0),0,0,1);
DRAWKLINE(H,O,L,C);
买线:=EMA(C,3);
卖线:=EMA(SLOPE(C,25)*18+C,55);
BU:=CROSS(买线,卖线);
SEL:=CROSS(卖线,买线);
ISDOWN:=IF(CLOSE<OPEN,1,0);
ISUP:=IF(CLOSE>OPEN,1,0);
STICKLINE(买线<卖线 AND ISDOWN,HIGH,OPEN,0,0),COLORCYAN;
STICKLINE(买线<卖线 AND ISDOWN,CLOSE,OPEN,3,0),COLORCYAN;
STICKLINE(买线<卖线 AND ISDOWN,CLOSE,LOW,0,0),COLORCYAN;
STICKLINE(买线>=卖线 AND ISUP,HIGH,CLOSE,0,1),COLORRED;
STICKLINE(买线>=卖线 AND ISUP,CLOSE,OPEN,3,1),COLORRED;
STICKLINE(买线>=卖线 AND ISUP,OPEN,LOW,0,1),COLORRED;
STICKLINE(买线>=卖线 AND ISDOWN,CLOSE,LOW,0,0),COLORRED;
STICKLINE(买线>=卖线 AND ISDOWN,HIGH,OPEN,0,0),COLORRED;
STICKLINE(买线>=卖线 AND ISDOWN,CLOSE,OPEN,3,1),COLORRED,LINETHICK2;
STICKLINE(买线>=卖线 AND ISDOWN,CLOSE*1.0018,OPEN*0.9988,1.8,0),COLORCYAN;
STICKLINE(买线<卖线 AND ISUP,HIGH,CLOSE,0,1),COLORCYAN;
STICKLINE(买线<卖线 AND ISUP,CLOSE,OPEN,3,1),COLORCYAN;
STICKLINE(买线<卖线 AND ISUP,OPEN,LOW,0,1),COLORCYAN;
{MA1:MA(CLOSE,5);
MA2:MA(CLOSE,13),LINETHICK2;
MA3:MA(CLOSE,21);
MA4:MA(CLOSE,62),LINETHICK2;
MA120:MA(CLOSE,120);
MA6:MA(CLOSE,250);}
DRAWBMP(BU=1,L,'B');
DRAWBMP(SEL=1,HIGH*1.038,'S');
{======================================================}
范围高A:=REFDATE(HHV(H,120),DATE)*1.05;
范围低A:=REFDATE(LLV(L,120),DATE)*0.95;
MA5:=MA(C,5),COLORCYAN,LINETHICK2;
MA24:=MA(C,24),COLORGREEN,LINETHICK2;
MA72:=MA(C,72),COLORRED,LINETHICK2;
MA200:=IF((MA(C,200)<=范围高A AND MA(C,200)>=范围低A) OR C>=MA(C,200),MA(C,200),DRAWNULL),COLORBLUE,LINETHICK2;
{=======================仪表盘=========================}
主升浪:=ISLASTBAR AND MA5>MA24 AND MA24>MA72 AND MA72>IF(MA200=DRAWNULL,0,MA200);
主浪回调:=ISLASTBAR AND MA24>MA5 AND MA5>MA72 AND MA72>IF(MA200=DRAWNULL,0,MA200);
主浪深调:=ISLASTBAR AND MA24>MA72 AND MA72>MA5 AND MA5>IF(MA200=DRAWNULL,0,MA200);
初升浪:=ISLASTBAR AND IF(MA200=DRAWNULL,300,MA200)>MAX(MA24,MA72) AND MA5>MA24 AND MA24>MA72;
底部反弹:=ISLASTBAR AND IF(MA200=DRAWNULL,300,MA200)>MA72 AND MA72>MA24 AND MA5>MA24;
探底阶段:=ISLASTBAR AND IF(MA200=DRAWNULL,300,MA200)>MA72 AND MA72>MA24 AND MA24>MA5;
观望:=ISLASTBAR AND IF(MA200=DRAWNULL,MA24>MA72 AND C<MA72,MA72>MA200 AND C<MA200);
有牛:=ISLASTBAR AND IF(MA200=DRAWNULL,MA24<MA72 AND C>=MA72,MA72<MA200 AND C>=MA200);
放弃:=ISLASTBAR AND IF(MA200=DRAWNULL,MA24<MA72 AND C<MA72,MA72<MA200 AND C<MA200);
DRAWGBK(显示仪表盘1=1 AND 主升浪=0 AND 主浪回调=0 AND 主浪深调=0 AND 初升浪=0 AND 底部反弹=0 AND 探底阶段=0 AND 观望=0 AND 有牛=0 AND 放弃=0,0,0,0,'观望',0)COLOR00BF00;
DRAWGBK(显示仪表盘1=1 AND 主升浪,0,0,0,'主升浪',0)COLORFF00FF;
DRAWGBK(显示仪表盘1=1 AND 主浪回调,0,0,0,'主浪回调',0)COLORFF8080;
DRAWGBK(显示仪表盘1=1 AND 主浪深调,0,0,0,'主浪深调',0)COLOR009500;
DRAWGBK(显示仪表盘1=1 AND 初升浪,0,0,0,'初升浪',0)COLOR00FFFF;
DRAWGBK(显示仪表盘1=1 AND 底部反弹,0,0,0,'底部反弹',0)COLORFFFF00;
DRAWGBK(显示仪表盘1=1 AND 探底阶段,0,0,0,'探底阶段',0);
DRAWGBK(显示仪表盘1=1 AND 观望,0,0,0,'观望',0)COLORFFFF00;
DRAWGBK(显示仪表盘1=1 AND 有牛,0,0,0,'有牛',0)COLOR00FFFF;
DRAWGBK(显示仪表盘1=1 AND 放弃,0,0,0,'放弃',0)COLOR00BF00;
高1:=REF(HHV(H,120),3);
低1:=REF(LLV(L,120),3);
H1:=高1-(高1-低1)*0.191;
H2:=高1-(高1-低1)*0.382;
H3:=高1-(高1-低1)*0.5;
H4:=高1-(高1-低1)*0.618;
H5:=高1-(高1-低1)*0.809;
突破:=REF(EMA(C,55),1);
A1X:=(EMA(C,10)-突破)/突破*100;
基准:=IF(A1X>=0,REF(EMA(C,10),BARSLAST(CROSS(A1X,0))+1),REF(EMA(C,10),BARSLAST(CROSS(0,A1X))+1));
STICKLINE(A1X>=0,基准,突破,5,0),COLOR000099;
STICKLINE(A1X<0,基准,突破,5,0),COLOR00CC66;
AA:=CROSS(A1X,0),LINETHICK0;
STICKLINE(A1X>=0,C,O,2.7,0),COLOR0011FF;
STICKLINE(A1X>=0,C,O,1.8,0),COLOR0044FF;
STICKLINE(A1X>=0,C,O,0.9,0),COLOR0077FF;
STICKLINE(A1X>=0,C,O,0.1,0),COLOR0099FF;
STICKLINE(A1X>=0,H,L,0,0),COLOR0099FF;
STICKLINE(AA,C,O,2.7,0),COLOR330033;
STICKLINE(AA,C,O,1.8,0),COLOR770077;
STICKLINE(AA,C,O,0.9,0),COLORBB00BB;
STICKLINE(AA,C,O,0.1,0),COLORFF00FF;
STICKLINE(AA,H,L,0,0),COLORFF00FF;
{DRAWICON(AA,C*0.92,9);}
DRAWTEXT(AA,C*0.98,'买'),COLORRED;
BB:=CROSS(0,A1X),LINETHICK0;
STICKLINE(A1X<0,C,O,2.7,0),COLORAAAAAA;
STICKLINE(A1X<0,C,O,1.8,0),COLORCCCCCC;
STICKLINE(A1X<0,C,O,0.9,0),COLORDDDDDD;
STICKLINE(A1X<0,C,O,0.1,0),COLORFFFFFF;
STICKLINE(A1X<0,H,L,0,0),COLORFFFFFF;
STICKLINE(BB,C,O,2.7,0),COLOR333300;
STICKLINE(BB,C,O,1.8,0),COLOR555500;
STICKLINE(BB,C,O,0.9,0),COLOR777700;
STICKLINE(BB,C,O,0.1,0),COLOR999900;
STICKLINE(BB,H,L,0,0),COLOR999900;
{ DRAWICON(BB,C*1.05,15);}
DRAWTEXT(BB,C*1.01,'卖'),COLOR00FF00;
620566177.jpg
|