N:=25;
P:=100;
RSV1:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K1:=MA(RSV1,1),COLORCYAN;
D1:MA(K1,4),COLORYELLOW;
STICKLINE(D1>=80 ,70,50,9,0),COLORGREEN;
STICKLINE(D1<=20 ,50,30,9,1),COLORRED;
L1:80,COLORGRAY;
L3:50,COLORGRAY;
L2:20,COLORGRAY;
DRAWICON(D1>50 AND REF(D1,1)<=50 AND LLV(D1,30)<=20,D1,1);
DRAWICON(D1<50 AND REF(D1,1)>=50 AND HHV(D1,30)>=80,D1,2);
MA1:=EMA(CLOSE,P-20),COLORGREEN,LINETHICK2;
MA2:=MA(CLOSE,P-20),COLORRED,LINETHICK2;
MA3:=EMA(CLOSE,P),COLORLIBLUE,LINETHICK2;
MA4:=MA(CLOSE,P),COLORYELLOW,LINETHICK2;
STICKLINE(MA3>MA4 ,-20,-10,9,0),COLORMAGENTA;
STICKLINE(MA1>MA2 ,0,-10,9,0),COLORYELLOW;
STICKLINE(MA3