DIF:EMA(CLOSE,12)-EMA(CLOSE,26); DEA:EMA(DIF,9),COLORYELLOW; MACD:=(DIF-DEA)*2,COLORWHITE; _MACD紅柱_:IF(MACD>REF(MACD,1),MACD,DRAWNULL), STICK,COLORRED,LINETHICK1; _MACD綠柱_:IF(MACD<REF(MACD,1),MACD,DRAWNULL), STICK,COLORGREEN,LINETHICK1; 低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1; JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0)); 二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; A1:=BARSLAST(REF(CROSS(DIF,DEA),1)); 底背離:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); 底背:DRAWLINE(A1=0,DEA,底背離,DEA,0),COLORRED,LINETHICK4; {DRAWTEXT(底背離,0,' 底背離'),COLORFF00FF;} A2:=BARSLAST(REF(CROSS(DEA,DIF),1)); 頂背離:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); 頂背:DRAWLINE(A2=0,DEA,頂背離,DEA,0),COLORGREEN,LINETHICK4; DRAWTEXT(低位金叉 AND 二次金叉 AND 底背離,0,'三全項'),COLOR0000FF,LINETHICK2; |
|