分享

自用MACD,集合大家之长

 昵称6682149 2014-05-02
DIF1:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA1:=EMA(DIF1,9);
MACD1:=2*(DIF1-DEA1);MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,8,0),COLOR000055;
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,5,0),COLOR000077;
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,3,0),COLOR000099;
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLOR0000FF;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,8,0),COLOR555555;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,5,0),COLOR777777;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,3,0),COLOR999999;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORFFFFFF;
STICKLINE(MACD1<MACD2,0,MACD1,8,0),COLORB20000;
STICKLINE(MACD1<MACD2,0,MACD1,5,0),COLOREC0000;
STICKLINE(MACD1<MACD2,0,MACD1,3,0),COLORFF4600;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORFFAB00;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
低位金叉:=CROSS(DIF1,DEA1) AND DIF1<-0.1;
STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;
DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BARSLAST(DEA1>=0));
二次金叉:=CROSS(DIF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;
DRAWICON(二次金叉,DEA1*0.9,1) ;
DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;
DIF:DIF1,COLOR33FF33;
DEA:DEA1,COLORYELLOW;
MACD:MACD1,LINETHICK,COLORMAGENTA;
强度:PARTLINE(DIF1>=DEA1,DIF1),COLORRED,LINETHICK2;
A1:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF1>REF(DIF1,A1+1) AND CROSS(DIF1,DEA1);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA1,底背离,DEA1,0),COLORRED,LINETHICK3;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA1,DIF1),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF1,A2+1)>DIF1 AND CROSS(DEA1,DIF1);
顶背:DRAWLINE(A2=0,DEA1,顶背离,DEA1,0),COLORGREEN,LINETHICK3;

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多