全功能KDJ+MACD大智慧L2副图指标(原码),祝大家春节愉快,新年发财!
随机指标KDJ与指数平滑异同平均线MACD是抄月殳不可少的传统指标,把它们叠加并将各周期的金死叉融汇在一起,细细品味,融会贯通,对于指导中线和波段高抛低吸的操作中,有作不可估量的作用。现将本人整编的大智慧L2的KDJ叠加MACD同图副图指标及原码提供出来,作为春节礼物送给喜欢用KDJ和MACD参考操作的朋友,希望大家喜欢。并祝创幻的网友春节愉快,在新的一年里股市操作顺利,多多发财,全家幸福安康!
写在指标中的注释:
使用说明:据此操作,风险自负!
本指标将传统的随机指标KDJ与指数平滑异同平均线MACD有机结合在一起,便于波段操作高抛低吸,以期获得更大的利率(指标内含有#MONTH和#WEEK两个周期函数,使用中出现周金(死)叉或月金(死)叉的提示不能作为买或加仓或卖的参考依据)。
1、KDJ指标>80 时,回档机率大;KDJ指标<20 时,反弹机率大;
2、K在20左右向上交叉D或DIFF向上交叉DEA(MACD)时,视为买进信号;
3、K在80左右向下交叉D或DIFF向下交叉DEA(MACD)时,视为卖出信号;
4、J>100时,股价易反转下跌;J<0 时,股价易反转上涨;
5、KDJ波动于50左右的任何信号,其作用不大;
6、K连续两次向下交叉D或DIFF连续两次向下交叉DEA(MACD),将造成较大的跌幅;
7、K连续向上交叉D或DIFF连续两次向上交叉DEA(MACD),将造成较大的涨幅;
8、指标与股价形成背离时产生的信号,可信度较高;
9、只有当DEA线走平并形成上升趋势时,才可参照KDJ高抛低吸做波段;
10、参考顶(绿)线挖坑次日卖出或高抛低吸做波段,底(淡黄)线挖坑次日买进;
11、可参考20值红虚线持股,80值红虚线做波段;
12、可参考买、短10%、佳点、最佳点、量价齐上等提示视情买进或持股或加仓。
全功能KDJ+MACD副图原码
DRAWGBK(close>0,STRIP(RGB(25,25,112),RGB(47,79,79),0));
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),LINETHICK2,COLORWHITE;
D:SMA(K,3,1),LINETHICK2,COLOR00DDDD;
J:3*K-2*D,LINETHICK2,COLOR800080;
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),linethick0,COLOR0099FF;
DEA :EMA(DIFF,9),linethick0,COLORD89837;
MACD:2*(DIFF-DEA),COLORFF9999,linethick0;
YLZC:=if(close=INDEXC,(INDEXC+INDEXh+INDEXl+INDEXO)/4,AMOUNT/(vol+0.01)/100);
阻价:=if(close=INDEXC,YLZC+INDEXC-INDEXl,YLZC+(close-low));
支价:=if(close=INDEXC,INDEXl+INDEXC-YLZC,low+(close-YLZC));
今压:REF(阻价,1),LINETHICK0,COLORAA11BB;
今撑:REF(支价,1),LINETHICK0,COLOR009900;
明压:阻价,LINETHICK0;
明撑:支价,LINETHICK0;
rsv1:=(hhv(h,9.8)-c)/(hhv(h,9.8)-llv(l,9.8))*101;
kk:=sma(rsv1,3,1);
dd:=sma(kk,3,1);
jj:=3*kk-2*dd;
买卖:=if(jj>=100,100,if(jj<=0,0,jj));
明天买:if(买卖=100,0-10,0),color00cccc;
明天卖:if(买卖=0,90,100),color00ff00;
KX:=250;
KH:=HHV(K,KX);
DH:=HHV(D,KX);
JH:=HHV(J,KX);
KL:=LLV(K,KX);
DL:=LLV(D,KX);
JL:=LLV(J,KX);
HKMAX:=MAX(KH,MAX(DH,JH));
LKMIN:=MIN(KL,MIN(DL,JL));
KHLB:=(HKMAX+LKMIN)/2;
KHLC:=HKMAX-LKMIN;
MHF:=HHV(DIFF,KX);
MHD:=HHV(DEA,KX);
MHM:=HHV(MACD,KX);
MLF:=LLV(DIFF,KX);
MLD:=LLV(DEA,KX);
MLM:=LLV(MACD,KX);
HMAX:=MAX(MHF,MAX(MHD,MHM));
LMIN:=MIN(MLF,MIN(MLD,MLM));
FHLB:=(HMAX-LMIN)/100;
FHLC:=HMAX-LMIN;
SH:=(0-FHLB)*(KHLC/FHLC)+KHLB;
DIFFA:=(DIFF-FHLB)*(KHLC/FHLC)+KHLB;
DEAA:=(DEA-FHLB)*(KHLC/FHLC)+KHLB;
MACDA:=(macd-FHLB)*(KHLC/FHLC)+KHLB;
CDA:=MACD<ref(MACD,1) and MACD>0;
CDB:=MACD>=ref(MACD,1) and MACD>0;
CDC:=MACD>ref(MACD,1) and MACD<0;
CDD:=MACD<=ref(MACD,1) and MACD<0;
STICKLINE(CDA,SH,macda,6,0),COLOR00AAFF;{黄s段}
STICKLINE(CDA,SH,macda,6.6,0),COLOR00BBFF;
STICKLINE(CDA,SH,macda,4.4,0),COLOR00CCFF;
STICKLINE(CDA,SH,macda,3.3,0),COLOR00DDFF;
STICKLINE(CDA,SH,macda,2.2,0),COLOR00EEFF;
STICKLINE(CDA,SH,macda,1.1,0),COLOR00FFFF;
STICKLINE(CDB,SH,macda,6,0),COLOR0000AA; {红色段}
STICKLINE(CDB,SH,macda,6.6,0),COLOR0011BB;
STICKLINE(CDB,SH,macda,4.4,0),COLOr0022CC;
STICKLINE(CDB,SH,macda,3.3,0),COLOR0033DD;
STICKLINE(CDB,SH,macda,2.2,0),COLOR0044EE;
STICKLINE(CDB,SH,macda,1.1,0),COLOR0055FF;
STICKLINE(CDC,SH,macda,6,0),COLORAA00BB;{向上粉红}
STICKLINE(CDC,SH,macda,6.6,0),COLORBB11BB;
STICKLINE(CDC,SH,macda,4.4,0),COLORCC22BB;
STICKLINE(CDC,SH,macda,3.3,0),COLORDD33BB;
STICKLINE(CDC,SH,macda,2.2,0),COLOREE44BB;
STICKLINE(CDC,SH,macda,1.1,0),COLORFF55BB;
STICKLINE(CDD,SH,macda,6,0),COLORFF7700;
STICKLINE(CDD,SH,macda,6.6,0),COLORFF8811;
STICKLINE(CDD,SH,macda,4.4,0),COLORFFAA22;
STICKLINE(CDD,SH,macda,3.3,0),COLORFFBB33;
STICKLINE(CDD,SH,macda,2.2,0),COLORFFDD44;
STICKLINE(CDD,SH,macda,1.1,0),COLORFFDD55;
PARTLINE(DIFFA,DIFF>0,RGB(255,153,153),DIFF<0,RGB(255,153,153));
PARTLINE(DEAA,DEA>0,RGB(65,105,225),DEA<0,RGB(65,105,225));
DRAWTEXT(BARSTATUS=2,SH,' 0'),color00aaaa;
TYP:=(HIGH+LOW+CLOSE)/3;
STICKLINE(diff>ref(diff,1),20,20,2,0),COLORRED;
STICKLINE(diff<ref(diff,1),20,20,2,0),COLORGREEN;
STICKLINE(K>=ref(K,1) or k>d and diff>ref(diff,1),80,80,2,1),COLORRED;
STICKLINE(K<ref(K,1),80,80,2,1),COLORGREEN;
MACD金叉:=CROSS(MACD,DIFF) AND MACD>=(0-0.05) AND MACD<=0.02;
DRAWTEXT(MACD金叉,macda*0.82,'MACD金叉'),color00FFFF;
XX:=ema(MA(LOW,3)*0.96,30);
DIFF金叉:=if(CROSS(DIFF,DEA) AND XX-REF(XX,1)>0 AND MACD>=REF(MACD,1) AND DIFF<=0,1,0);
DRAWTEXT(DIFF金叉=1,DIFFA*1.68,'DIFF金叉'),colorCDFFBB;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
DRAWTEXT(低位金叉,deaa*0.99,' 低位金叉'),COLOR0099DD;
DIFDEA:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(DIFDEA=2,21)=1;
DRAWTEXT(二次金叉,deaa*0.99-8,' 二次金叉'),ColorFF00FF;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
DRAWTEXT(底背离,DEAA*0.99-16,' 底背离'),Color0099FF;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(FILTER(顶背离,5),DEAA*1.02,'顶背离'),COLORDDAAAA;
{周金叉,死叉}
周DIFF:="MACD.DIFF#WEEK";
周DEA:="MACD.DEA#WEEK";
周MACD:="MACD.MACD#WEEK";
DIF周金叉:=CROSS(周DIFF,周DEA);
DRAWTEXT(DIF周金叉,DEAA,'DIFF周金叉'),COLOR0099FF;
DRAWTEXT(CROSS(周DEA,周DIFF),DEAA+4,'DIFF周死叉'),align0,COLORCDFFBB;
MACD周金叉:=CROSS(周MACD,周DIFF) AND 周MACD>=(0-0.05) AND 周MACD<=0.02;
DRAWTEXT(MACD周金叉,macda-0.03,'MACD周金叉'),color00FFFF;
{月金叉,死叉}
月DIFF:="MACD.DIFF#MONTH";
月DEA:="MACD.DEA#MONTH";
DIF月金叉:=CROSS(月DIFF,月DEA);
DRAWTEXT(DIF月金叉,DEAA*0.98,'DIF月金叉'),COLOR00FFCC;
DRAWTEXT(CROSS(月DEA,月DIFF),DEAA*1.02,'DIF月死叉'),align0,COLORDDDDDD;
周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 K<20,4);
drawtext(月金叉,月D-2,'★'),ALIGN0,color0022ee;
DRAWTEXT(月金叉,月D-2,'KD月金叉'),colory |