RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,M1,1);
D:=SMA(K,M2,1);
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD:=(DIF-DEA)*2;
(CROSS(K,D) AND (CROSS(DIF,DEA) OR CROSS(REF(DIF,1),REF(DEA,1)) OR CROSS(REF(DIF,2),REF(DEA,2))))
OR (CROSS(DIF,DEA) AND (CROSS(K,D) OR CROSS(REF(K,1),REF(D,1)) OR CROSS(REF(K,2),REF(D,2))))
;