通达信指标公式源码KDJ金叉.doc
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
RQ:=IF(DATE+1900000020080630,1,0);
K:SMA(RSV,3,1)*RQ,LINETHICK2,COLORWHITE;
D:SMA(K,3,1),LINETHICK2,COLOR00DDDD;
J:3*K-2*D,LINETHICK2,COLORBB00CC;
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
CDA:=MACDREF(MACD,1) AND MACD0;
CDB:=MACD=REF(MACD,1) AND MACD0;
CDC:=MACDREF(MACD,1) AND MACD0;
CDD:=MACD=REF(MACD,1) AND MACD0;
STICKLINE(MACD=0,79,80,5,1),COLORBB00AA;
STICKLINE(MACD0,79,80,5,1),COLORGREEN;
STICKLINE(CDB OR CDC,19,20,5,1),COLORBB00AA;
STICKLINE(CDD OR CDA,19,20,5,1),COLORGREEN;
周K:=KDJ.K#WEEK(9,3,3);
周D:=KDJ.D#WEEK(9,3,3);
周J:=KDJ.J#WEEK(9,3,3);
月K:=KDJ.K#MONTH(9,3,3);
月D:=KDJ.D#MONTH(9,3,3);
月J:=KDJ.J#MONTH(9,3,3);
月金叉:=CROSS(月K,月D);
周金叉:=CROSS(周K,周D);
日金叉:=FILTER(CROSS(K,D) AND D20,4);
DRAWTEXT(月金叉,K*1.028, KD月金叉),COLORYELLOW;
DRAWTEXT(周金叉 OR 月金叉,周D*0.96,★),COLOR0022EE;
DRAWTEXT(周金叉,周D*0.96, KD周金叉),COLORGREEN;
DRAWTEXT(日金叉,K,KD金叉),COLORFF00FF;
DRAWTEXT(CROSS(KDJ.D#WEEK(9,3,3),KDJ.K#WEEK(9,3,3)) ,K+6,KD周死叉),COLORFFF000;
DRAWTEXT(CROSS(KDJ.D#MONTH(9,3,3),KDJ.K#MONTH(9,3,3)),D-6,KD月死叉),COLORFFFFFF;
KDB:=BARSLAST(REF(CROSS(K,D),1));
KDDB:=REF(CLOSE,KDB+1)CLOSE AND REF(K,KDB+1)K AND CROSS(K,D);
K底背:=IF(FILTER(KDDB0,5),1,0);
DRAWTEXT(K底背=1,D*0.45,KD底背离),COLOR0099FF;
KDD:=BARSLAST(REF(CROSS(D,K),1));
K顶背:=REF(CLOSE,KDD+1)CLOSE AND REF(K,KDD+1)K AND CROSS(D,K);
特别提示:本信息由相关用户自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。