A1:=BARSLAST(REF(CROSS("MACD.DIF","macd.DEA"),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
SHORT:=12;
LONG:=26;
MID:=9;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
BC1:=DIF>0 AND DEA>0;
BC2:=BC1!=REF(BC1,1) AND B1;
BC3:=COUNT(CROSS(DIF,DEA),BARSLAST(BC2))=1 AND CROSS(DIF,DEA) AND BC1;
BC4:=COUNT(CROSS(DIF,DEA),BARSLAST(BC2))=2 AND CROSS(DIF,DEA) AND BC1;
BC5:=REF(DIF,BARSLAST(BC3))<=REF(DIF,BARSLAST(BC4));
零上二金:BC4 AND BC5;
九毛八公式解读
A1赋值:上次1日前的"平滑异同平均的DIF"上穿"平滑异同平均的DEA"距今天数 B1赋值:A1+1日前的收盘价>收盘价 AND A1+1日前的"平滑异同平均的DIF"<"平滑异同平均的DIF" AND "平滑异同平均的DIF"上穿"平滑异同平均的DEA" SHORT赋值:12 LONG赋值:26 MID赋值:9 DIF赋值:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均 DEA赋值:DIF的MID日指数移动平均 BC1赋值:DIF>0 AND DEA>0 BC2赋值:BC1不等于1日前的BC1 AND B1 BC3赋值:统计上次BC2距今天数日中满足DIF上穿DEA的天数=1 AND DIF上穿DEA AND BC1 BC4赋值:统计上次BC2距今天数日中满足DIF上穿DEA的天数=2 AND DIF上穿DEA AND BC1 BC5赋值:上次BC3距今天数日前的DIF<=上次BC4距今天数日前的DIF 输出零上二金:BC4 AND BC5