通达信股票公式:分时主图+自动画线源码
STICKLINE(C》0,H,L,6,1),COLOR000000;
分时线:C,COLOR8800FF,LINETHICK1;
MA55:MA(C,55),COLOR663636;
A:=CURRBARSCOUNT;
A1:=DAY!=REF(DAY,1);
A2:=BARSLAST(A1)+1;
A3:=MA(C,A2);
A4:=SUM(AMO,A2)/SUM(VOL,A2)/100;
A5:=IF(CAPITAL》0,A4,A3);
现价:IF(A《=CONST(A2),CLOSE,DRAWNULL)COLOR0098FF,LINETHICK1;
均价:IF(A《=CONST(A2),A5,DRAWNULL),COLORFF9800,LINETHICK1;
前收盘:IF(A《=CONST(A2),DYNAINFO(3),DRAWNULL),COLORRED,LINETHICK1;
RC:=DYNAINFO(3);
S2:=SMA(C,2,1);
S6:=SMA(C,6,1);
DK:=2*(S2-S6);
STICKLINE(DK》0,RC,RC+DK,0,1),COLOR000036;
STICKLINE(DK《0,RC,RC+DK,0,1),COLOR003600;
AA1:=REF(分时线,P)=HHV(分时线,2*P+1);
BB1:=FILTER(AA1,P);
CC1:=BACKSET(BB1,P+1);
DD1:=FILTER(CC1,P);{高点}
AA2:=REF(分时线,P)=LLV(分时线,2*P+1);
BB2:=FILTER(AA2,P);
CC2:=BACKSET(BB2,P+1);
DD2:=FILTER(CC2,P);{低点}
上:=REF(分时线,BARSLAST(DD1)),COLORFF00FF,NODRAW;
下:=REF(分时线,BARSLAST(DD2)),COLOR00FF00,NODRAW;
相对能量:(分时线-下)/(上-下)*100,COLORYELLOW,NODRAW;
R11:=BACKSET(ISLASTBAR,BARSLAST(DD1)+1);
S11:=R11》REF(R11,1);
压力线:DRAWLINE(DD1,分时线,S11,分时线,1),COLORYELLOW;
T11:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);
U11:=T11》REF(T11,1);
支撑线:DRAWLINE(DD2,分时线,U11,分时线,1),COLOR00FF00;
STICKLINE(C》0,下,下,1,0),COLOR00FF00;
STICKLINE(C》0,上,上,1,0),COLORFF00FF;
DRAWICON(DD1,分时线,2);
DRAWICON(DD2,分时线,1);
STICKLINE(C》0,H,L,6,1),COLOR000000;
分时线:C,COLOR8800FF,LINETHICK1;
MA55:MA(C,55),COLOR663636;
A:=CURRBARSCOUNT;
A1:=DAY!=REF(DAY,1);
A2:=BARSLAST(A1)+1;
A3:=MA(C,A2);
A4:=SUM(AMO,A2)/SUM(VOL,A2)/100;
A5:=IF(CAPITAL》0,A4,A3);
现价:IF(A《=CONST(A2),CLOSE,DRAWNULL)COLOR0098FF,LINETHICK1;
均价:IF(A《=CONST(A2),A5,DRAWNULL),COLORFF9800,LINETHICK1;
前收盘:IF(A《=CONST(A2),DYNAINFO(3),DRAWNULL),COLORRED,LINETHICK1;
RC:=DYNAINFO(3);
S2:=SMA(C,2,1);
S6:=SMA(C,6,1);
DK:=2*(S2-S6);
STICKLINE(DK》0,RC,RC+DK,0,1),COLOR000036;
STICKLINE(DK《0,RC,RC+DK,0,1),COLOR003600;
AA1:=REF(分时线,P)=HHV(分时线,2*P+1);
BB1:=FILTER(AA1,P);
CC1:=BACKSET(BB1,P+1);
DD1:=FILTER(CC1,P);{高点}
AA2:=REF(分时线,P)=LLV(分时线,2*P+1);
BB2:=FILTER(AA2,P);
CC2:=BACKSET(BB2,P+1);
DD2:=FILTER(CC2,P);{低点}
上:=REF(分时线,BARSLAST(DD1)),COLORFF00FF,NODRAW;
下:=REF(分时线,BARSLAST(DD2)),COLOR00FF00,NODRAW;
相对能量:(分时线-下)/(上-下)*100,COLORYELLOW,NODRAW;
R11:=BACKSET(ISLASTBAR,BARSLAST(DD1)+1);
S11:=R11》REF(R11,1);
压力线:DRAWLINE(DD1,分时线,S11,分时线,1),COLORYELLOW;
T11:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);
U11:=T11》REF(T11,1);
支撑线:DRAWLINE(DD2,分时线,U11,分时线,1),COLOR00FF00;
STICKLINE(C》0,下,下,1,0),COLOR00FF00;
STICKLINE(C》0,上,上,1,0),COLORFF00FF;
DRAWICON(DD1,分时线,2);
DRAWICON(DD2,分时线,1);