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

    正文概述    2024-04-13 10:19:55  

    明 :红箭头买入;白箭头持股;绿箭头卖出。

    注:请将参数:
    SHDRT 2 200 12 改为:
    SHORT 2 200 12 (即D改为:O)

    全部参数:
    SHORT 2 200 12
    LONG 2 200 26
    MID 2 200 9
    N1 2 100 6
    LL1 2 100 20
    LH1 2 100 80
    (抱歉,后面漏掉参数: LL1 2 100 20
    LH1 2 100 80 )

    {MACD买卖}
    M21:=MA(C,21);
    M55:=MA(C,55);
    A0:=M21 REF(M21,1) AND M55 REF(M55,1);
    A1:=COUNT(V REF(V,1),2)
    A3:=KDJ.K KDJ.D;
    A4:=MACD.DIF
    A5:=CCI.CCI
    A6:=C BOLL.BOLL;
    {ST:=IF(NAMELIKE('S'),0,1) AND IF(NAMELIKE('*'),0,1);}
    S2:=DYNAINFO(4)
    A0 AND A1 AND A3 AND A4 AND A5 AND A6 AND S2;
    DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
    DEA:EMA(DIF,MID);
    MACD:(DIF-DEA)*2,COLORSTICK;
    IF(DIF REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;
    IF(DIF =REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;
    {MACD提示};
    B1:=REF(C,A1+1) C AND REF( MACD.DIF ,A1+1) MACD.DIF AND CROSS( MACD.DIF , MACD.DEA
    DRAWICON(B1 0,DIF*1.21,1);{MACD底背离}
    C1:=BARSLAST(REF(CROSS( MACD.DEA , MACD.DIF ),1));
    D1:=REF(C,C1+1) C AND REF( MACD.DIF ,C1+1) MACD.DIF AND CROSS( MACD.DEA , MACD.DIF
    DRAWICON(D1 0,DEA*1.21,2);{MACD顶背离};
    WQ:= RSI.RSI1 (N1,2,2);
    ENTERLONG:CROSS(WQ,LL1),COLORRED;
    EXITLONG:CROSS(LH1,WQ),COLORGREEN;
    DIFF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
    ZERO:0;
    GJ:=MAX(C,O);
    STICKLINE(MACD 0 AND MACD =REF(MACD,1),0,MACD,2,0),COLOR0000FF;
    STICKLINE(MACD 0 AND MACD REF(MACD,1),0,MACD,2,0),COLORFFFF00;
    STICKLINE(MACD 0 AND MACD =REF(MACD,1),0,MACD,2,0),COLORFF00FF;
    STICKLINE(MACD 0 AND MACD REF(MACD,1),0,MACD,2,0),COLOR00FF00;
    L4:=LLV(GJ,4);
    JL:=(HHV(DIFF,55)-LLV(DIFF,55))/5;
    GT:=DEA REF(DEA,1) AND REF(DEA,1) REF(DEA,2);
    A1Y:=BARSLAST(REF(GT,1));
    底背离:=REF(L4,A1Y+1) CLOSE AND DIFF REF(DIFF,A1Y+1) AND GT;
    DRAWLINE(A1Y=0,DEA,底背离,REF(DEA,A1Y),0),COLORRED,LINETHICK2;
    DRAWLINE(底背离,DEA,底背离,REF(DEA,A1Y),0),COLORRED,LINETHICK2;
    DRAWTEXT(底背离,REF(DEA,A1)*1.18,' 底背离'),COLORFF00FF;
    H4:=HHV(GJ,4);
    GT2:=DEA REF(DEA,1) AND REF(DEA,1) REF(DEA,2);
    A2:=BARSLAST(REF(GT2,1));
    顶背离:= REF(H4,A2+1) H4 AND DIFF REF(DIFF,A2+1) AND GT2;
    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;

    通达信MACD买卖副图公式源码

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 通达信MACD买卖副图公式源码 加入收藏