DIF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA:=EMA(DIF,9);MACD:=2*(DIF-DEA);A:=BARSLAST(DEA>=0);{上次DEA>=0距今天数}T:=COUNT(CROSS(DIF,DEA),A);{统计DEA<0的这段时间DIF金叉DEA的次数}三次金叉:CROSS(DIF,DEA) AND COUNT(T=3,A)=1;