DRAWTEXT_FIX(1,0.0,0.0,0,GNBLOCK)COLORYELLOW;
DRAWTEXT_FIX(1,0.96,0.99,0,HYBLOCK),COLORYELLOW;
MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
VARR1:=(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210;
VARR2:=MA(VARR1,17);
A1:=C>REF(C,4);
A2:=BARSLASTCOUNT(A1);
A3:=REF(A2,1)=8 AND A2>REF(A2,1);
A4:=REF(BETWEEN(A2,5,8),1) AND A2< REF(A2,1);
A5:=ISLASTBAR AND BETWEEN(A2,1,8);
A6:=(BACKSET(A3>0,9) OR BACKSET(A4>0,A2+1)*0 OR BACKSET(A5>0,A2))*A2;
DRAWTEXT(A6>0,H+H*0.005,VAR2STR(A6,0)),COLOR00FFFF;
DRAWTEXT(A2=9,H+H*0.005,'9'),COLORGREEN;
B1:=C< REF(C,4);
B2:=BARSLASTCOUNT(B1);
B3:=REF(B2,1)=8 AND B2>REF(B2,1);
B4:=REF(BETWEEN(B2,5,8),1) AND B2< REF(B2,1);
B5:=ISLASTBAR AND BETWEEN(B2,1,8);
B6:=(BACKSET(B3>0,9) OR BACKSET(B4>0,B2+1)*0 OR BACKSET(B5>0,B2))*B2;
DRAWTEXT(B6>0,L-L*0.005,VAR2STR(B6,0)),COLORGREEN;
DRAWTEXT(B2=9,L-L*0.005,'9'),COLORRED;
攻击线:VARR1,LINETHICK2,COLORRED;
趋势线:VARR2,LINETHICK2,COLORYELLOW;