以下是通达信最优主图源码和截图
通达信最优均线主图源码:
投机线:ma(c,5)+ma(c,200),colorf00ff0;
操作线:ma(c,21)+ma(c,200),coloryellow;
底线:ma(c,55)+ma(c,200),color00ff00;
if(c =o,h+ma(c,200),l+ma(c,200)),stick,linethick0,color0000ff;
if(c =o,c+ma(c,200),l+ma(c,200)),stick,linethick3,color0000ff;
if(c =o,o+ma(c,200),l+ma(c,200)),stick,linethick3,color0000ff;
if(c =o,o+ma(c,200),l+ma(c,200)),stick,linethick3,color000000;
if(c =o,o+ma(c,200),l+ma(c,200)),stick,linethick1,color0000ff;
if(c =o,l+ma(c,200),l+ma(c,200)),stick,linethick1,color000000;
if(c o,h+ma(c,200),l+ma(c,200)),stick,linethick0,colorffff00;
if(c o,o+ma(c,200),l+ma(c,200)),stick,linethick3,colorffff00;
if(c o,c+ma(c,200),l+ma(c,200)),stick,linethick3,color000000;
if(c o,c+ma(c,200),l+ma(c,200)),stick,linethick1,colorffff00;
if(c o,l+ma(c,200),l+ma(c,200)),stick,linethick1,color000000;
aa:投机线,colorf00ff0;
bb:操作线,coloryellow;
cc:底线,color00ff00;
STICKLINE(8=8,H,L,4,1),COLOR000000;{隐藏K线[设置与背景色一样]}
CURR:=CURRBARSCOUNT;
DRAWKLINE(IF(CURR 3,REFX(H,3),DRAWNULL),IF(CURR 3,REFX(O,3),DRAWNULL),
IF(CURR 3,REFX(L,3),DRAWNULL),IF(CURR 3,REFX(C,3),DRAWNULL));
RM5:IF(CURR 3,REFX(MA(C,5),3),DRAWNULL),COLOR0000FF;
RM10:IF(CURR 3,REFX(MA(C,10),3),DRAWNULL),COLOR00FFFF;
RM20:IF(CURR 3,REFX(MA(C,20),3),DRAWNULL),COLORFF0000;
ABSM5:=CONST(IF(MA(C,5)-REF(MA(C,5),1) 0,ABS(MA(C,5)-REF(MA(C,5),1)),0-ABS(MA(C,5)-REF(MA(C,5),1))));
ABSM10:=CONST(IF(MA(C,10)-REF(MA(C,10),1) 0,ABS(MA(C,10)-REF(MA(C,10),1)),0-ABS(MA(C,10)-REF(MA(C,10),1))));
ABSM20:=CONST(IF(MA(C,20)-REF(MA(C,20),1) 0,ABS(MA(C,20)-REF(MA(C,20),1)),0-ABS(MA(C,20)-REF(MA(C,20),1))));
R2M5:=IF(CURR=3,CONST(MA(C,5))+ABSM5,DRAWNULL);
R2M10:=IF(CURR=3,CONST(MA(C,10))+ABSM10,DRAWNULL);
R2M20:=IF(CURR=3,CONST(MA(C,20))+ABSM20,DRAWNULL);
R1M5:=IF(CURR=2,CONST(MA(C,5))+2*ABSM5,DRAWNULL);
R1M10:=IF(CURR=2,CONST(MA(C,10))+2*ABSM10,DRAWNULL);
R1M20:=IF(CURR=2,CONST(MA(C,20))+2*ABSM20,DRAWNULL);
R0M10:=IF(ISLASTBAR,CONST(MA(C,10))+3*ABSM10,DRAWNULL);
R0M20:=IF(ISLASTBAR,CONST(MA(C,20))+3*ABSM20,DRAWNULL);
DRAWLINE(CURR=4,RM5,CURR=3,R2M5,0),COLOR0000FF,DOTLINE;
DRAWLINE(CURR=3,R2M5,CURR=2,R1M5,0),COLOR0000FF,DOTLINE;
DRAWLINE(CURR=4,RM10,CURR=3,R2M10,0),COLOR00FFFF,DOTLINE;
DRAWLINE(CURR=3,R2M10,CURR=2,R1M10,0),COLOR00FFFF,DOTLINE;
DRAWLINE(CURR=2,R1M10,ISLASTBAR,R0M10,0),COLOR00FFFF,DOTLINE;
DRAWLINE(CURR=4,RM20,CURR=3,R2M20,0),COLORFF0000,DOTLINE;
DRAWLINE(CURR=3,R2M20,CURR=2,R1M20,0),COLORFF0000,DOTLINE;
DRAWLINE(CURR=2,R1M20,ISLASTBAR,R0M20,0),COLORFF0000,DOTLINE;
MA1:MA(CLOSE,3),LINETHICK3;
MA2:MA(CLOSE,6),LINETHICK3;
MA3:MA(CLOSE,20),COLORBLUE,LINETHICK2;
MA4:MA(CLOSE,50),LINETHICK3;
高区18:IF(CURRBARSCOUNT =18,CONST(IF(ISLASTBAR=1,HHV(H,BARSLAST(CURRBARSCOUNT=18)),0)),DRAWNULL),COLORYELLOW;
低区18:IF(CURRBARSCOUNT =18,CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=18)),0)),DRAWNULL),COLORYELLOW;
高:=REF(HHV(H,80),3);
低:=REF(LLV(L,80),3);
H19:=高-(高-低);
H38:=高-(高-低);
H中:=高-(高-低);
H61:=高-(高-低);
H80:=高-(高-低);
顶点:REFDATE(高,DATE),POINTDOT,LINETHICK2,COLORWHITE;
低点:REFDATE(低,DATE),POINTDOT,LINETHICK2,COLORWHITE;
C2:=REF(C,1);
:=IF((C-C2)*100/C2 =(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),,COLORYELLOW;
STICKLINE(涨停,H,L,0,0),,COLORYELLOW;
跌停:=IF((C2-C)*100/C2 =(10-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;N:=10;
高1:=REF(HHV(H,1),3);
低1:=REF(LLV(L,1),3);
HH19:=高-(高-低);
HH38:=高-(高-低);
HH中:=高-(高-低);
HH61:=高-(高-低);
HH80:=高-(高-低);
顶点1:REFDATE(高1,DATE),COLORWHITE;
低点1:REFDATE(低1,DATE),COLORWHITE;
DRAWLINE(CURRBARSCOUNT=TOTALBARSCOUNT,CONST(C),CURRBARSCOUNT=1,C,3)DOTLINE;
通达信最优均线主图截图