m:= 3;
LOWV:=LLV (low, n);
HIGHV:=HHV (high, n);
RSV:= EMA((CLOSE-LOWV)/(HIGHV-LOWV)* 100,M);
K:=EMA(RSV,M);
D:=MA(K,M);
A 1:=BARSLAST(REF(CROSS(K,D), 1));
Bottom deviation: REF(CLOSE, A 1+ 1) > close and K & gtREF(K, A 1+ 1) and CROSS(K, d);