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多头发散;
九毛八公式解读
DIF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均 DEA赋值:DIF的9日指数移动平均 MACD赋值:(DIF-DEA)*2 N赋值:4 DIF1赋值:收盘价的12*N日指数移动平均-收盘价的26*N日指数移动平均 A1赋值:上次1日前的DIF上穿DEA距今天数 DIF多头发散赋值:DIF/1日前的DIF>1.03 AND DIF>0 DIF1多头发散赋值:DIF1/1日前的DIF1>1.03 AND DIF1>0 输出XUANGU:A1>5 AND A1<=13 AND DIF上穿DEA AND DIF多头发散 AND DIF1多头发散