N:=9;M1:=3;M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,M1,1),LINETHICK2;
D:SMA(K,M2,1),LINETHICK2,COLORRED;
BDL:=MA(Abs(K-REF(K,1)),10);
DD:=LLV(K,N)+BDL,DOTLINE;
GD:=HHV(K,N)-BDL,DOTLINE;
SJ:=BArslAST(crOSS(K,GD));
SJ1:=BARSLAST(CROSS(DD,K));
GLX:IF(SJ<SJ1,DD,GD),NODRAW;
IF(SJ<SJ1,DD,DRAWNULL),COLORRED,CIRCLEDOT;
IF(SJ>SJ1,GD,DRAWNULL),COLORGREEN,CIRCLEDOT;