?DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE; DEA:EMA(DIF,9),COLORYELLOW,LINETHICK1; MACD:(DIF-DEA)*2,COLORSTICK; STICKLINE(MACD>0,0,MACD,2,0),COLORRED; STICKLINE(MACD<0,0,MACD,2,0),COLORGREEN; STICKLINE(MACD>REF(MACD,1) AND MACD<0 ,0,MACD,2,0),COLORFF00FF; STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,2,0),COLORLIBLUE; 上翹:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK1; 下拐:IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORLIBLUE,LINETHICK1; DRAWTEXT(CROSS(DIF,DEA),DEA,'金'),COLORYELLOW; DRAWTEXT(CROSS(DEA,DIF),DEA,'死'),COLORGREEN; A1:=BARSLAST(REF(CROSS(DIF,DEA),1)); 底背離:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); STICKLINE(底背離,DEA*1.09,DEA*0.86,6,0),COLOR00FF00; DRAWLINE(A1=0,DEA,底背離,DEA,0),COLORRED,LINETHICK1; DRAWTEXT(底背離,DEA*1.09,'底'),COLORWHITE; B1:=BARSLAST(REF(CROSS(DEA,DIF),1)); 頂背離:=REF(CLOSE,B1+1)<CLOSE AND REF(DIF,B1+1)>DIF AND CROSS(DEA,DIF); DRAWLINE(B1=0,DEA,頂背離,DEA,0),COLORGREEN,LINETHICK1; DRAWTEXT(頂背離,DEA*1.2,'頂'),COLOR00FF00; |
|