最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 通达信MACD背离钝化指标公式

    正文概述    2024-04-13 15:14:30  

    DIFF:EMA(CLOSE,9) - EMA(CLOSE,26),COLORWHITE;
    DEA:EMA(DIFF,12),COLORYELLOW;
    macd=2*(DIFF-DEA);
    ZERO : 0;
    GJ:=MAX(C,O);
    L4:=LLV(GJ,4);
    JL:=(HHV(DIFF,55)-LLV(DIFF,55))/5;
    GT:=DEA>REF(DEA,1) AND REF(DEA,1) A1:=BArslAST(REF(GT,1));
    STICKLINE(MacD>0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLOR0000FF;
    STICKLINE(MACD>0 AND MACD STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORFF00FF;
    STICKLINE(MACD<0 AND MACD 底背离:=REF(L4,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND GT;
    DRAWLINE(A1=0,DEA,底背离,REF(DEA,A1),0),COLORRED,LINETHICK2;
    DRAWLINE(底背离,DEA,底背离,REF(DEA,A1),0),COLORRED,LINETHICK2;
    DRAWTEXT(底背离,REF(DEA,A1)*1.18,' 底背离'),COLORFF00FF;
    H4:=HHV(GJ,4);
    GT2:=DEAREF(DEA,2);
    A2:=BARSLAST(REF(GT2,1));
    顶背离:= REF(H4,A2+1)

    DRAWLINE(A2=0 ,DEA,顶背离,REF(DEA,A2),0),COLORGREEN,LINETHICK2;
    DRAWLINE(顶背离,DEA,顶背离,REF(DEA,A2),0),COLORGREEN,LINETHICK2;
    DRAWTEXT(顶背离,REF(DEA,A2)*1.18,' 顶背离'),COLORGREEN;
    死叉:=crOSS(DEA,DIFF);
    DRAWICON(死叉,DIFF*0.95,'2');
    N1:BARSLAST(死叉),NODRAW;
    N2:REF(BARSLAST(死叉),N1+1),NODRAW;
    N3:REF(BARSLAST(死叉),N2+N1+2),NODRAW;
    CL1:=LLV(C,N1+1),NODRAW;
    DIFL1:=LLV(DIFF,N1+1),NODRAW;
    CL2:=REF(CL1,N1+1),NODRAW;
    DIFL2:=REF(DIFL1,N1+1),NODRAW;
    CL3:=REF(CL2,N1+1),NODRAW;
    DIFL3:=REF(DIFL2,N1+1),NODRAW;
    pdiFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1);
    mdiFL2:=INTPART(DIFL2/POW(10,PDIFL2));
    PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1);
    MDIFL3:=INTPART(DIFL3/POW(10,PDIFL3));
    MDIFB2:=INTPART(DIFF/POW(10,PDIFL2));
    MDIFB3:=INTPART(DIFF/POW(10,PDIFL3));
    直接底背离:=(CL1MDIFL2) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB2<=REF(MDIFB2,1);
    隔峰底背离:=(CL1MDIFL3) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB3<=REF(MDIFB3,1);
    B:直接底背离 OR 隔峰底背离,NODRAW;
    BG:((MDIFB2>REF(MDIFB2,1))*REF(直接底背离,1)) OR ((MDIFB3>REF(MDIFB3,1))*REF(隔峰底背离,1)),NODRAW;
    底背离消失:=(REF(直接底背离,1) AND DIFL1<=DIFL2 ) OR (REF(隔峰底背离,1) AND DIFL1<=DIFL3);
    STICKLINE(B OR BG,DIFF,DEA,8,0),COLORRED,LINETHICK2;
    DRAWTEXT((B AND COUNT(B,2)=1),(DIFF*1.5),'钝'),COLORYELLOW;
    DRAWTEXT(FILTER(BG,10),DIFF*1.5,'成'),COLORMAGENTA;
    DRAWTEXT(FILTER(底背离消失,10),(DIFF+MACD),'失'),COLORGREEN;
    STICKLINE(BG,0,DIFF+DEA,5,0),COLORRED,LINETHICK3;
    金叉:=CROSS(DIFF,DEA);
    DRAWICON(金叉,DIFF*0.95,'1');
    M1:=BARSLAST(金叉),NODRAW;
    M2:=REF(BARSLAST(金叉),M1+1);
    M3:=REF(BARSLAST(金叉),M2+M1+2);
    CH1:=HHV(C,M1+1),NODRAW;
    DIFH1:=HHV(DIFF,M1+1),NODRAW;
    CH2:=REF(CH1,M1+1),NODRAW;
    DIFH2:=REF(DIFH1,M1+1),NODRAW;
    CH3:=REF(CH2,M1+1),NODRAW;
    DIFH3:=REF(DIFH2,M1+1),NODRAW;
    PDIFH2:=IF(DIFH2>0,INTPART(LOG(DIFH2))-1,INTPART(LOG(-DIFH2))-1);
    MDIFH2:=INTPART(DIFH2/POW(10,PDIFH2));
    PDIFH3:=IF(DIFH3>0,INTPART(LOG(DIFH3))-1,INTPART(LOG(-DIFH3))-1);
    MDIFH3:=INTPART(DIFH3/POW(10,PDIFH3));
    MDIFT2:=INTPART(DIFF/POW(10,PDIFH2));
    MDIFT3:=INTPART(DIFF/POW(10,PDIFH3));
    直接顶背离:=(CH1>CH2 ) AND (MDIFT20 AND REF(MACD,1)>0) AND MDIFT2>=REF(MDIFT2,1);
    隔峰顶背离:=(CH1>CH3 AND CH3>CH2 ) AND (MDIFT30 AND REF(MACD,1)>0) AND MDIFT3>=REF(MDIFT3,1);
    T:=直接顶背离 OR 隔峰顶背离,NODRAW;
    TG:=((MDIFT2 顶背离消失:=(REF(直接顶背离,1) AND DIFH1>=DIFH2 ) OR (REF(隔峰顶背离,1) AND DIFH1>=DIFH3);
    STICKLINE(TG,0,DIFF+DEA,5,0), COLORGREEN,LINETHICK4;
    STICKLINE(T OR TG,DIFF,DEA,8,0),COLORGREEN,LINETHICK2;
    DRAWTEXT(FILTER(TG,20),DIFF*1.4,'成'),COLORMAGENTA;
    DRAWTEXT(FILTER(顶背离消失,20),(DIFF+MACD),'失'),COLORGREEN;


    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 通达信MACD背离钝化指标公式 加入收藏