{背离副图}
diff:ema(close,12)-ema(close,26);
dea:ema(diff,9),colorff;
macd:2*(diff-dea),colorstick;
d1:=ema(close,3)-ema(close,8);
d2:=ema(open,3)-ema(open,8);
d3:=ema(high,3)-ema(high,8);
d4:=ema(low,3)-ema(low,8);
stickline(d1>=d2,d1,d2,7,1),color0080ff;
stickline(d1<=d2,d1,d2,7,1),colorff00;
a1:=barslast(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
b1:=ref(close,a1+1)>close 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));
macd底背离:=filter(b1>0,5);
drawtext(macd底背离,0.30,'macd\n底\n背\n离'),colorff00;
a2:=barslast(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
b2:=ref(close,a2+1)>close 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));
kdj底背离:=filter(b2>0,5);
drawtext(kdj底背离,0.20,'kdj\n底\n背\n离'),colorffff;
a3:=barslast(ref(cross("rsi.rsi1"(6,12,24),"rsi.rsi2"(6,12,24)),1));
b3:=ref(close,a3+1)>close 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));
rsi底背离:=filter(b3>0,5);
drawtext(rsi底背离,0.34,'rsi\n底\n背\n离'),colorffcc66;
c1:=barslast(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1));
d1:=ref(close,c1+1)<close 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));
macd顶背离:=filter(d1>0,5);
drawtext(macd顶背离,0.33,'macd\n顶\n背\n离'),color66ff;
c2:=barslast(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
d2:=ref(close,c2+1)<close 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));
kdj顶背离:=filter(d2>0,5);
drawtext(kdj顶背离,0.31,'kdj\n顶\n背\n离'),colorf8f343;
c3:=barslast(ref(cross("rsi.rsi2"(6,12,24),"rsi.rsi1"(6,12,24)),1));
d3:=ref(close,c3+1)<close 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));
rsi顶背离:=filter(d3>0,5),colorff00ff;
drawtext(rsi顶背离,0.32,'rsi\n顶\n背\n离'),colorff00ff;
底背离选股:(macd底背离 or kdj底背离 or rsi底背离)/3.5;
顶背离选股:(macd顶背离 or kdj顶背离 or rsi顶背离)/3.5;
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));
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;
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,0.12,6,0),colorred;
stickline(b2>0,0,0.12,6,0),colorff00ff;
stickline(b3>0,0,0.12,6,0),coloryellow;
stickline(d1>0,0,0.12,6,0),color00ff00;
stickline(d2>0,0,0.12,6,0),colorffcc66;
stickline(d3>0,0,0.12,6,0),colorwhite;
上一指标公式:★不败大白鲨★-自用主图公式 飞狐不败指标 源码
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文背离副图-MACDKDJ背离公式 飞狐背离指标 源码仅供学习研究。