T1:=21;
T2:=89;
短线顶:EMA(H,T1),colorgreen;
短线底:EMA(L,T1),colorred;
A111:=POLYLINE(C>短线顶,短线顶);
NOTEXT_A222:IF(C>短线顶,A111,DRAWNULL),colorred;
B111:=POLYLINE(C>短线底,短线底);
NOTEXT_B222:IF(C>短线底,B111,DRAWNULL),colorred;
STICKLINE(C>短线顶,短线顶,短线底,0.01,1),colorred;
STICKLINE(C<短线底,短线顶,短线底,0.01,1),colorgreen;
长线顶:EMA(H,T2),colormagenta;
长线底:EMA(L,T2),colorblue;
C1111:=POLYLINE(C>长线顶,长线顶);
NOTEXT_C2222:IF(C>长线顶,C1111,DRAWNULL),colormagenta;
D1111:=POLYLINE(C>长线底,长线底);
NOTEXT_D2222:IF(C>长线底,D1111,DRAWNULL),colormagenta;
STICKLINE(C>长线顶,长线顶,长线底,0.01,1),colormagenta;
STICKLINE(C<长线底,长线顶,长线底,0.01,1),colorblue;
短线空:=C<短线底;
短线多:=C>短线顶;
短线空1:=REF(C,1)>REF(短线底,1) AND C<短线底;
短线多1:=REF(C,1)<REF(短线顶,1) AND C>短线顶;
长线空:=C<长线底;
长线多:=C>长线顶;
长线空1:=REF(C,1)>REF(长线底,1) AND C<长线底;
长线多1:=REF(C,1)<REF(长线顶,1) AND C>长线顶;
仓位10:=(短线多 AND 长线多1) OR (短线多1 AND 长线多);
DRAWTEXT(仓位10,L*0.98,'拾'),coloryellow;
仓位6:=(短线空 AND 长线多1) OR (短线空1 AND 长线多) ;
DRAWTEXT(仓位6,H*0.98,'陆'),coloryellow;
仓位4:=(短线多 AND 长线空1) OR (短线多1 AND 长线空);
DRAWTEXT(仓位4,L*0.98,'肆'),coloryellow;
仓位0:=(短线空 AND 长线空1) OR (短线空1 AND 长线空);
DRAWTEXT(仓位0,H*0.98,'零'),coloryellow;
A1:=C>REF(C,4);
NT:=BArslASTCOUNT(A1);
TJ11:=NT=9;
TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);
AY:=(BacKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;
DRAWTEXT(AY>0,H*1.02,VAR(AY,0)),COLORFF00FF;
DRAWTEXT(NT=9,H*1.02,'9'),colorgreen;
B1:=C<REF(C,4);
NT0:=BARSLASTCOUNT(B1);
TJ21:=NT0=9 ;
TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8);
AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0;
DRAWTEXT(AY1>0,L*0.98,VAR(AY1,0)),COLORFF00FF;
DRAWTEXT(NT0=9,L*0.98,'9'),colorgreen;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
DRAWICON(crOSS(J,0),L*0.98,3);
DRAWICON(CROSS(100,J),H*1.02,2);