DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
N:=4;
DIF1:=EMA(CLOSE,12*N)-EMA(CLOSE,26*N);
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
DIF多头发散:=DIF/REF(DIF,1)>1.03 AND DIF>0;
DIF1多头发散:=DIF1/REF(DIF1,1)>1.03 AND DIF1>0;
XUANGU:A1>5 AND A1<=13 AND CROSS(DIF,DEA) AND DIF多头发散 AND DIF1多头发散;