DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),colorred;
DEA:EMA(DIFF,9),colorgreen;
:(DIFF-DEA)*2,COLORSTICK;
DIF:=EMA(CLOSE,5)-EMA(CLOSE,26);
DDEA:=EMA(DIF,3);
DMACD:=(DIF-DDEA)*2;
JC:=CROSS(DIFF ,0);
T:=BARSLAST(JC);
JCM:=CROSS(DIFF ,DEA) AND DIFF 0 AND DEA
零轴上二次金:=COUNT(JCM,T)=2 AND JCM;
日金:=CROSS(DIFF,DEA);
周DIF:=MA(DIF,5);
周DEA:=MA(DDEA,5);
日周:=CROSS(周DIF,周DEA) AND 日金 AND MACD;
DRAWTEXT(日周,0.3, 周 ),colorlimagenta;
DRAWTEXT(零轴上二次金,DIFF , 二 ),colorred,LINETHICK2;
低位:=CROSS(DIFF ,DEA) AND DIFF -0.1;
JCCOUNT:=COUNT(CROSS(DIFF ,DEA),BARSLAST(DEA =0));
二次金叉:=CROSS(DIFF ,DEA) AND DEA 0 AND COUNT(JCCOUNT=2,21)=1;
A1:=BARSLAST(REF(CROSS(DIFF ,DEA),1));
底背离:=REF(CLOSE,A1+1) CLOSE AND DIFF REF(DIFF ,A1+1) AND CROSS(DIFF ,DEA);
A2:=BARSLAST(REF(CROSS(DEA,DIFF ),1));
顶背离:=REF(CLOSE,A2+1) CLOSE AND REF(DIFF ,A2+1) DIFF AND CROSS(DEA,DIFF );
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25, 三全项 ),COLOR0000FF,LINETHICK2;
DRAWTEXT(低位金叉,0.16, 低位金叉 ),colorwhite;
DRAWTEXT(底背离,0.12, 底背离 ),COLORFF00FF;