DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACDDIF-DEA)*2,COLORSTICK;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
底背RAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背RAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;
C1:=FINDLOW(DIF,BARSLAST(CROSS(MACD.MACD,0))+1,10,1);
D1:=FINDLOW(C,BARSLAST(CROSS(MACD.MACD,0))+1,10,1);
底钝:C<D1 AND DIF>C1 AND MACD<0,COLORYELLOW;
底结:底钝 AND DIF>REF(DIF,1),COLORRED;
DRAWTEXT(底钝,0,' *'),COLORYELLOW;
DRAWTEXT(底结,0,' *'),COLORRED;
C2:=FINDHIGH(DIF,BARSLAST(CROSS(DEA,DIF))+1,10,1);
D2:=FINDHIGH(C,BARSLAST(CROSS(DEA,DIF))+1,10,1);
顶钝:C>D2 AND DIF<C2 AND MACD>0,COLORBLUE;
顶结:顶钝 AND DIF<REF(DIF,1),COLORGREEN;
DRAWTEXT(顶钝,0,' *'),COLORBLUE;
DRAWTEXT(顶结,0,' *'),COLORGREEN;
|