N:=9;
M:=3;
LOWV:=LLV(LOW,N);
HIGHV:=HHV(HIGH,N);
RSV:=EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,M);
A:EMA(RSV,M);
B:MA(A,M);
VAR1:=3;
VAR2:=((3* SMA((((CLOSE - LLV(LOW,27)) / (HHV(HIGH,27) - LLV(LOW,27))) * 100),5,1)) - (2
* SMA(SMA((((CLOSE - LLV(LOW,27)) / (HHV(HIGH,27) - LLV(LOW,27))) *
100),5,1),3,1)));
买:IF(CROSS(VAR2,VAR1),100,0);