N:=9;
M1:=3;
M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,M1,1);
D:=SMA(K,M2,1);
J:=3*K-2*D;
VAR2:=REF(LOW,1);
VAR3:=SMA(Abs(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100;
VAR4:=EMA(VAR3*10,3);
VAR5:=LLV(LOW,13);
VAR6:=HHV(VAR4,13);
VAR7:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618;
VAR8:=IF(VAR7>500,500,VAR7);
STICKLINE(VAR8>-120,0,VAR8,9,1),colorgray;
STICKLINE(VAR8>1 AND J>REF(J,1) AND REF(J,1)
STICKLINE(VAR8>0.1 AND VAR8<1 AND J>REF(J,1) AND REF(J,1)
YD:=IF(crOSS(0.9,1/vol*1000>0.01 AND "J"<0),1,0);
DRAWICON(YD=1,80,1);