MACD在0轴上第3次金叉的选股公式。
编写公式源码:DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=(DIFF-DEA)*2;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
金叉:=CROSS(DIFF,DEA) AND DEA>0 AND COUNT(JCCOUNT=1,21)=1;
T1:=BARSLAST(金叉);
二金叉:=CROSS(DIFF,DEA) AND DEA>0 AND DEA>REF(DEA,T1) AND COUNT(JCCOUNT=2,21)=1;
T2:=BARSLAST(二金叉);
三金叉:CROSS(DIFF,DEA) AND BETWEEN(DEA,0,0.2) AND DEA>REF(DEA,T2) AND COUNT(JCCOUNT=3,28)=1;