DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
JC:=CROSS(DIF,DEA) AND DEA>0;
SC:=CROSS(DEA,DIF) AND DEA>0;
TJ:=BARSLAST(JC);
TS:=BARSLAST(SC);
XG:COUNT(JC,20)=1 AND COUNT(SC,20)=1 AND TJ>TS AND CROSS(MACD>REF(MACD,1),0.5) AND DIF>0 AND DEA>0;
编写条件:
MACD零轴之上第一次死叉后再金叉的选股公式(金叉可以不是已经实际金叉,只macd绿柱开始缩短即可)。
编写方法:
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
JC:=CROSS(DIF,DEA) AND DEA>0;
SC:=CROSS(DEA,DIF) AND DEA>0;
TJ:=BARSLAST(JC);
TS:=BARSLAST(SC);
XG:COUNT(JC,20)=1 AND COUNT(SC,20)=1 AND TJ>TS AND CROSS(MACD>REF(MACD,1),0.5) AND DIF>0 AND DEA>0;