通达信MACD多金叉选股公式源码

DIF:=EMA(CLOSE,12)-EMA(CLOSE,27);

DEA:=EMA(DIF,9);

MACD:=2*(DIF-DEA);

A:=BARSLAST(DEA >=0);

T:=COUNT(CROSS(DIF,DEA),A);

三次金叉:CROSS(DIF,DEA) AND COUNT(T=3,A)=1;