DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);:=(DIF-DEA)*2;T:=BARSLAST(OSS(DIF,DEA) AND DIF<0 T1:=SUMBARS(T T2:=SUMBARS(T M:=BARSLAST(CROSS(0,MACD));M1: SUMBARS(M=0,2);M2: SUMBARS(M=0,3);D1: REF(DIF,BARSLAST(DIF=LLV(DIF,M+1)));D2: REF(D1,T1-1);D3:=REF(D2,T1-1);LT: BARSLAST(L=LLV(L,M+1));L1: REF(L,LT);L2:=REF(L1,T1-1);L3: REF(L2,T1-1);XG:T=0>D2 AND D2>D3;