全功能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;{黄色段}
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月金叉'),coloryellow;
drawtext(周金叉,周d,'★'),align2,color0022ee;
drawtext(周金叉,周d,' kd周金叉'),colorgreen;
drawicon(日金叉,k,1),align2;
drawtext(日金叉,d-6,'低位金叉'),color00cccc;
drawtext(cross(周d,周k),周d*1.2,'kd周死叉'),color00ddbb;
drawtext(cross(月d,月k),月d,'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(kddb>0,5),1,0);
drawtext(k底背=1,d*0.98,'底背离'),colordddddd;
kdd:=barslast(ref(cross(d,k),1));
k顶背:=ref(close,kdd+1)<close and ref(k,kdd+1)>k and cross(d,k);
drawtext(filter(k顶背>0,5),d+8,'顶背离'),colorffaa22;
md1:=ma(close,80)-ma(close,13)/3;
md2:=ma((close-md1)/md1,3);
买点1:=cross(md2,0) and low/ref(high,1)<1.012 and j<75 and j>ref(j,1);
ma12:=ma(close,12);
佳点:=if(filter(macd>=ref(macd,5) and open<=ref(close,1) and xx-ref(xx,1)>0 and macd<=0 and ma12-ref(ma12,1)>=0,3) and j<80 and j>ref(j,1) and d>ref(d,1) and (diff>=ref(diff,1) or dea>=ref(dea,1)),1,0);
drawtext(佳点=1,macda*0.98,'佳点'),color0099ff;
dx0:=ema(close,2)-ema(open,5);
dx1:=if(cross(dx0,macd) and low<=xx and macd<=(0-0.11) and (j<20 or k<20),1,0);
drawtext(filter(dx1,3),0,'短10%'),color00cc00;{短线}
ma10:=ma(close,10);
ss:=ema(ma(high,3)*1.05,30);
lqs:=if(filter(0.7*(cross(diff,dea) and close<ss and xx-ref(xx,1)>0 and cross(macd,0) and macd>=0 and diff>0 and ma10-ref(ma10,1)>0 and vol>ref(vol,1))>=0.7 and (close<ss and xx-ref(xx,1)>0),5) and j<80,1,0);
drawtext(lqs=1,macda*0.98,'量价齐上'),colorcdffdd;{量价齐上}
最佳点:=if(count(md2>ref(md2,1),3)=3 and count(md2<0,10)=10 and ref(md2,3)=llv(md2,10) and j<80 and j>ref(j,1),1,0);
drawtext(最佳点=1,j,'最佳点'),colorff00cc;
买点2:=ref(md2,2)=llv(md2,20) and ref(md2,2)<0.071 and ref(md2,2)<ref(md2,1) and
not(ref(low,1)>ref(high,2) and low>ref(high,1)) and close>ref(close,1) and j<75 and j>ref(j,1);
drawtext(买点1 or 买点2,d-1,'买'),colorff00cc;
{预涨}
yz:=(intpart(sma(rsv,3,1))+intpart(sma(k,3,1)))/2;
预涨:=cross(yz,50) and j<95 and diff>ref(diff,1) and low<ref(close,1);
drawtext(预涨,d*0.6,'预涨'),colora52a2a;
kd金叉:=cross(k,d)and j>20 and j<80;
选股:if(cross(macd,0) or dx1 or 佳点 or lqs or k底背 or 月金叉 or 周金叉 or 日金叉 or 买点1 or 买点2 or 最佳点 or macd金叉 or diff金叉 or 低位金叉 or 二次金叉 or 底背离 or dif周金叉 or macd周金叉 or dif月金叉 or kd金叉,2,0),linethick0;
慎重声明:
指标内含有#month和#week两个周期函数,在操作使用中如出现“周金(死叉)叉或月金(死叉)”不能作为买或加仓或卖的参考依据。
关于周、月的线值,由于在日线下是日的周期,周线下是周的周期,月线下是月的周期,比如kdj的rsv参数日线是9天,周线是9周,月线则是9月,计算周线和月线不使用#week和#month函数在日线状态下其走势的准确度也很难达到目的。按照rsv以9的参数为例,计算公式为9日rsv=(c-l9)÷(h9-l9)×100,式中c为第9日的收盘价,l9为9日内的最低价,h9为9日内的最高价。kd的计算应是:当日k值=2/3×前一日k值+1/3×当日rsv,当日d值=2/3×前一日d值+1/3×当日k值。那么在日线下计算周线就是
rsvz:=(close-llv(low,45))/(hhv(high,45)-llv(low,45))*100;
周k:=sma(rsvz,15,1);
周d:=sma(周k,15,1);
周j:=3*周k-2*周d;
可是我在实际应用中的日线状态下将周k和周d的值改为周k:=sma(rsvz,11,1);周d:=sma(周k,11,1),效果几乎接近#week函数事后的结果。
以上仅供大家参考,希望能得到高手的指教!
上一指标公式:小小太阳公式 源码 大智慧小小
下一指标公式:思思实时公式 源码 大智慧实时
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文全功能KDJ+MACDL2副图公式 源码 大智慧指标全功能仅供学习研究。