老狼的四合一顶底背离公式源码及使用说明,(macd,rsi,kdj,dmi)(源码)
{四合一背离}
{研判原则:
这是macd,rsi,kdj,dmi指标组合的顶底背离指标,
0线上不同颜色柱是顶背离,也就是相对顶部,
0线下不同颜色的柱是底背离,也就是相对底部.
该指标的主要特点是:
运用macd这个指标的同时可看到其它几个指标的顶底预测点位,
为你介入卖出股票提供全方位的参考.}
{大智慧}【已经修改了大智慧可以用】
diff :=ema(close,12) - ema(close,26);
dea:=ema(diff,9);
macd :=(diff-dea)*2;
tr := sum(max(max(high-low,abs(high-ref(close,1))),abs(low-ref(close,1))),14);
hd := high-ref(high,1);
ld := ref(low,1)-low;
pdm:= sum(if(hd>0 and hd>ld,hd,0),14);
mdm:= sum(if(ld>0 and ld>hd,ld,0),14);
pdi:= pdm*100/tr;
mdi:= mdm*100/tr;
a1:=barslast(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
b1:=ref(c,a1+1)>c and ref("macd.diff"(12,26,9),a1+1)<"macd.diff"(12,26,9) and cross("macd.diff"(12,26,9),"macd.dea"(12,26,9));
a2:=barslast(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
b2:=ref(c,a2+1)>c and ref("kdj.k"(9,3,3),a2+1)<"kdj.k"(9,3,3) and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));
a3:=barslast(ref(cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24)),1));
b3:=ref(c,a3+1)>c and ref("rsi.rsi1"(6,12,24),a3+1)<"rsi.rsi1"(6,12,24) and cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24));
c1:=barslast(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1));
d1:=ref(c,c1+1)<c and ref("macd.diff"(12,26,9),c1+1)>"macd.diff"(12,26,9) and cross("macd.dea"(12,26,9),"macd.diff"(12,26,9));
c2:=barslast(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
d2:=ref(c,c2+1)<c and ref("kdj.k"(9,3,3),c2+1)>"kdj.k"(9,3,3) and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
c3:=barslast(ref(cross("rsi.rsi2"(6,12,24),"rsi.rsi1"(6,12,24)),1));
d3:=ref(c,c3+1)<c and ref("rsi.rsi1"(6,12,24),c3+1)>"rsi.rsi1"(6,12,24) and cross("rsi.rsi2"(6,12,24),"rsi.rsi1"(6,12,24));
c4:=barslast(ref(cross(mdi,pdi),1));
d4:=ref(c,c+1)<c and ref(mdi,c4+1)>mdi and cross(mdi,pdi);
a4:=barslast(ref(cross(pdi,mdi),1));
b4:=ref(c,a4+1)>c and ref(pdi,a4+1)<pdi and cross(pdi,mdi);
dmi底背:if(b4>0,-0.1,0),color0099ff,pointdot;
macd底背:if(b1>0,-0.1,0),colorred,pointdot;
kdj底背:if(b2>0,-0.1,0),colorff00ff,pointdot;
rsi底背:if(b3>0,-0.1,0),coloryellow,pointdot;
dmi顶背:if(d4>0,0.1,0),colorblue,pointdot;
macd顶背:if(d1>0,0.1,0),color00ff00,pointdot;
kdj顶背:if(d2>0,0.1,0),colorffcc66,pointdot;
rsi顶背:if(d3>0,0.1,0),colorwhite,pointdot;
stickline(b1>0,-0.1,0,6,0),colorred;
stickline(b2>0,-0.1,0,6,0),colorff00ff;
stickline(b3>0,-0.1,0,6,0),coloryellow;
stickline(d1>0,0.1,0,6,0),color00ff00;
stickline(d2>0,0.1,0,6,0),colorffcc66;
stickline(d3>0,0.1,0,6,0),colorwhite;
stickline(b4>0,-0.1,0,6,0),color0099ff;
stickline(d4>0,0.1,0,6,0),colorblue;
{通达信}
{好公式网 http://www.goodgongshi.com 整理}
{n1=12;n2=26;n3=9;n4=14;n5=24}
diff :=ema(close,n1) - ema(close,n2);
dea :=ema(diff,n3);
tr := sum(max(max(high-low,abs(high-ref(close,1))),abs(low-ref(close,1))),n4);
hd := high-ref(high,1);
ld := ref(low,1)-low;
pdm:= sum(if(hd>0 and hd>ld,hd,0),n4);
mdm:= sum(if(ld>0 and ld>hd,ld,0),n4);
pdi:= pdm*100/tr;
mdi:= mdm*100/tr;
a1:=barslast(ref(cross(diff,dea),1));
b1:=ref(c,a1+1)>c and ref(diff,a1+1)<diff and cross(diff,dea);
a2:=barslast(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
b2:=ref(c,a2+1)>c and ref("kdj.k"(9,3,3),a2+1)<"kdj.k"(9,3,3) and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));
a3:=barslast(ref(cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24)),1));
b3:=ref(c,a3+1)>c and ref("rsi.rsi1"(6,12,24),a3+1)<"rsi.rsi1"(6,12,24) and cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24));
c1:=barslast(ref(cross(dea,diff),1));
d1:=ref(c,c1+1)<c and ref(diff,c1+1)>diff and cross(dea,diff);
c2:=barslast(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
d2:=ref(c,c2+1)<c and ref("kdj.k"(9,3,3),c2+1)>"kdj.k"(9,3,3) and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
c3:=barslast(ref(cross("rsi.rsi2"(6,12,24),"rsi.rsi1"(6,12,24)),1));
d3:=ref(c,c3+1)<c and ref("rsi.rsi1"(6,12,24),c3+1)>"rsi.rsi1"(6,12,24) and cross("rsi.rsi2"(6,12,24),"rsi.rsi1"(6,12,24));
c4:=barslast(ref(cross(mdi,pdi),1));
d4:=ref(c,c+1)<c and ref(mdi,c4+1)>mdi and cross(mdi,pdi);
a4:=barslast(ref(cross(pdi,mdi),1));
b4:=ref(c,a4+1)>c and ref(pdi,a4+1)<pdi and cross(pdi,mdi);
dmi底背:if(b4>0,-0.1,0),color0099ff,pointdot;
macd底背:if(b1>0,-0.1,0),colorred,pointdot;
kdj底背:if(b2>0,-0.1,0),colorff00ff,pointdot;
rsi底背:if(b3>0,-0.1,0),coloryellow,pointdot;
dmi顶背:if(d4>0,0.1,0),colorblue,pointdot;
macd顶背:if(d1>0,0.1,0),color00ff00,pointdot;
kdj顶背:if(d2>0,0.1,0),colorffcc66,pointdot;
rsi顶背:if(d3>0,0.1,0),colorwhite,pointdot;
stickline(b1>0,-0.1,0,3,0),colorred;
stickline(b2>0,-0.1,0,3,0),colorff00ff;
stickline(b3>0,-0.1,0,3,0),coloryellow;
stickline(d1>0,0.1,0,3,0),color00ff00;
stickline(d2>0,0.1,0,3,0),colorffcc66;
stickline(d3>0,0.1,0,3,0),colorwhite;
stickline(b4>0,-0.1,0,3,0),color0099ff;
stickline(d4>0,0.1,0,3,0),colorblue;
上一指标公式:明列___板块全景指标详解 通达信公式
下一指标公式:抢反弹指标详解 通达信抢反弹
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文老狼的四合一顶底背离及使用说明MACDRSIKDJDMI指标详解 通达信使用说明公式仅供学习研究。