MACD,KDJ指标日线不同周期显示。相信大家,很多人都有类似的指标。我作的也就是去掉自以为多余的趋势线条,更一目了然的将各周期的金叉死叉信号显示出来。如果说精品指标是曲高和寡的阳春白雪,那么,这个小小的指标就是通俗易懂的下里巴人!
C/C++ www.gszb.com 股票公式指标网提供 Code复制内容到剪贴板
- input:n(9),m1(3),m2(3),LONG(26),SHORT(12),MID(9);
- refline:-40,0,40;
- DIFF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
- DEA:=EMA(DIFF,MID);
- MACD:=(DIFF-DEA)*2;
- RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
- K:=SMA(RSV,m1,1);
- D:=SMA(K,m2,1);
- J:=3*K-2*D;
- KDJ月金:CROSS("KDJ.K#MONTH"(N,M1,M2),"KDJ.D#MONTH"(N,M1,M2)),linethick0,colorred;
- MACD月金:CROSS("MACD.DIFF#MONTH"(LONG,SHORT,MID) ,"MACD.DEA#MONTH"(LONG,SHORT,MID)),linethick0,colorred;
- KDJ周金:CROSS("KDJ.K#WEEK"(N,M1,M2),"KDJ.D#WEEK"(N,M1,M2)),linethick0,colorMAGENTA;
- MACD周金:CROSS("MACD.DIFF#WEEK"(LONG,SHORT,MID) ,"MACD.DEA#WEEK"(LONG,SHORT,MID)),linethick0,colorMAGENTA;
- drawtextrel(5,10,'J月金'),linethick2,COLORred;{KDJ月金}
- drawtext(CROSS("KDJ.K#MONTH"(N,M1,M2),"KDJ.D#MONTH"(N,M1,M2)),39.5,'(√)'),linethick2,COLORred,ALIGN1;
- drawtextrel(5,90,'M月金'),linethick2,COLORred;{MACD月金}
- DRAWTEXT(CROSS("MACD.DIFF#MONTH"(LONG,SHORT,MID) ,"MACD.DEA#MONTH"(LONG,SHORT,MID)),33,'(√)'),COLOrred,ALIGN1;
- drawtextrel(5,170,'J周金'),linethick2,colorMAGENTA;{KDJ周金}
- drawtext(CROSS("KDJ.K#WEEK"(N,M1,M2),"KDJ.D#WEEK"(N,M1,M2)),26.5,'(√)'),linethick2,colorMAGENTA,ALIGN1;
- drawtextrel(5,250,'M周金'),linethick2,colorMAGENTA;{MACD周金}
- DRAWTEXT(CROSS("MACD.DIFF#WEEK"(LONG,SHORT,MID) ,"MACD.DEA#WEEK"(LONG,SHORT,MID)),20,'(√)'),COLORMAGENTA,ALIGN1;
- drawtextrel(5,330,'J日金'),linethick2,coloryellow;{KDJ日金}
- drawtext(cross(K,D),13.5,'(√)'),linethick2,coloryellow,ALIGN1;
- drawtextrel(5,410,'M日金'),linethick2,coloryellow;{MACD日金}
- DRAWTEXT(CROSS(DIFF,DEA),7,'(√)'),coloryellow,ALIGN1;
-
- drawtextrel(5,500,'M日死'),linethick2,colorwhite;{MACD日死}
- DRAWTEXT(CROSS(DEA,DIFF),0,'(×)'),colorwhite,ALIGN1;
- drawtextrel(5,580,'J日死'),linethick2,colorwhite;{KDJ日死}
- drawtext(cross(D,K),-6.5,'(×)'),linethick2,colorwhite,ALIGN1;
- drawtextrel(5,660,'M周死'),linethick2,colorblue;{MACD周死}
- DRAWTEXT(CROSS("MACD.DEA#WEEK"(LONG,SHORT,MID) ,"MACD.DIFF#WEEK"(LONG,SHORT,MID)),-13,'(×)'),colorblue,ALIGN1;
- drawtextrel(5,740,'J周死'),linethick2,colorblue;{KDJ周死}
- drawtext(CROSS("KDJ.D#WEEK"(N,M1,M2),"KDJ.K#WEEK"(N,M1,M2)),-19.5,'(×)'),linethick2,colorblue,ALIGN1;
- drawtextrel(5,820,'M月死'),linethick2,colorgreen;{MACD月死}
- DRAWTEXT(CROSS("MACD.DEA#MONTH"(LONG,SHORT,MID) ,"MACD.DIFF#MONTH"(LONG,SHORT,MID)),-26,'(×)'),colorgreen,ALIGN1;
- drawtextrel(5,900,'J月死'),linethick2,colorgreen;{KDJ月死}
- drawtext(CROSS("KDJ.D#MONTH"(N,M1,M2),"KDJ.K#MONTH"(N,M1,M2)),-32.5,'(×)'),linethick2,colorgreen,ALIGN1;
C/C++ www.gszb.com 股票公式指标网提供 Code复制内容到剪贴板
- input:n(9),m1(3),m2(3),LONG(26),SHORT(12),MID(9);
- DIFF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
- DEA:=EMA(DIFF,MID);
- MACD:=(DIFF-DEA)*2;
- RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
- K:=SMA(RSV,m1,1);
- D:=SMA(K,m2,1);
- J:=3*K-2*D;
- tjY:=CROSS("KDJ.K#MONTH"(N,M1,M2),"KDJ.D#MONTH"(N,M1,M2)) or CROSS("MACD.DIFF#MONTH"(LONG,SHORT,MID) ,"MACD.DEA#MONTH"(LONG,SHORT,MID));
- tjZ:=CROSS("KDJ.K#WEEK"(N,M1,M2),"KDJ.D#WEEK"(N,M1,M2)) or CROSS("MACD.DIFF#WEEK"(LONG,SHORT,MID) ,"MACD.DEA#WEEK"(LONG,SHORT,MID));
- XG:tjy{or tjz};
说明:1,引用了“月、周”周期,选股特别慢,没耐心者慎用,怕你砸了电脑!有耐心者也可用“XG:tjy or tjz;”替换公式最后一句,即变为"月金或周金"选股.
2,选股虽慢,测试结果显示,成功率不低。以下是“月金叉选股”,我的历史时间是09年至今,有图有真相: