A11:=C>REF(C,4);
NT1:=BArslASTCOUNT(A11);
TJ111:=NT1=13;
TJ131:=ISLASTBAR AND BETWEEN(NT1,10,12);
AYY:=(BacKSET(TJ111>0,13) OR BACKSET(TJ131>0,NT1))*NT1;
DRAWTEXT(AYY>0,H*1.02,VAR2STR(AYY,0)),COLORFF00FF;
高13:DRAWTEXT(NT1=13,H*1.02,'13'),COLORGREEN;
B11:=CNT10:=BARSLASTCOUNT(B11);
TJ211:=NT10=13 ;
TJ231:=ISLASTBAR AND BETWEEN(NT10,10,12);
AY11:=(BACKSET(TJ211>0,13) OR BACKSET(TJ231>0,NT10))*NT10;
DRAWTEXT(AY11>0,L*0.98,VAR2STR(AY11,0)),COLORFF00FF;
低13:DRAWTEXT(NT10=13,L*0.98,'13'),COLORGREEN;
A111:=C>REF(C,4);
NT11:=BARSLASTCOUNT(A111);
TJ1111:=NT11=18;
TJ1311:=ISLASTBAR AND BETWEEN(NT11,15,17);
AYYY:=(BACKSET(TJ1111>0,18) OR BACKSET(TJ1311>0,NT11))*NT11;
DRAWTEXT(AYYY>0,H*1.02,VAR2STR(AYYY,0)),COLORFF00FF;
高18:DRAWTEXT(NT11=18,H*1.02,'18'),COLORGREEN;
B111:=CNT110:=BARSLASTCOUNT(B111);
TJ2111:=NT110=18 ;
TJ2311:=ISLASTBAR AND BETWEEN(NT110,15,17);
AY111:=(BACKSET(TJ2111>0,18) OR BACKSET(TJ2311>0,NT110))*NT110;
DRAWTEXT(AY111>0,L*0.98,VAR2STR(AY111,0)),COLORFF00FF;
低18:DRAWTEXT(NT110=18,L*0.98,'18'),COLORGREEN;
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,VAR2STR(AY,0)),COLORFF00FF;
高9:DRAWTEXT(NT=9,H*1.02,'9'),COLORGREEN;
B1:=CNT0:=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,VAR2STR(AY1,0)),COLORFF00FF;
低9:DRAWTEXT(NT0=9,L*0.98,'9'),COLORGREEN;
中轴:MA(CLOSE,20),COLORYELLOW;
上轨:中轴+2*STD(CLOSE,20),COLOR00FF00,LINETHICK1;
下轨:中轴-2*STD(CLOSE,20),COLOR00FF00,LINETHICK1;