使用说明:指数平滑异同移动平均线。
1 dif和dea处于0轴以上时,属于多头市场。
2 dif和dea处于0轴以下时,属于空头市场。
3 柱状线收缩和放大。
4 震荡行情中macd指标将失真。
diff : ema(close,12) - ema(close,26);
dea : ema(diff,9);coloryellow,linethick1;
macd:2*(diff-dea);
zero : 0,linethick2;
gj:=max(c,o);
stickline(macd>0 and macd>=ref(macd,1),0,macd,2,0),color0000ff,linethick5;
stickline(macd>0 and macd<ref(macd,1),0,macd,2,0), colorffff00,linethick1;
stickline(macd<0 and macd>=ref(macd,1),0,macd,2,0),colorff00ff,linethick1;
stickline(macd<0 and macd<ref(macd,1),0,macd,2,0), color00ff00,linethick5;
l4:=llv(gj,4);
jl:=(hhv(diff,55)-llv(diff,55))/5;
gt:=dea>ref(dea,1) and ref(dea,1)<ref(dea,2);
a1:=barslast(ref(gt,1));
底背离:=ref(l4,a1+1)>close and diff>ref(diff,a1+1) and gt;
drawline(a1=0,dea,底背离,ref(dea,a1),0),colorred,linethick2;
drawline(底背离,dea,底背离,ref(dea,a1),0),colorred,linethick2;
drawtext(底背离,ref(dea,a1)*1.18,' 底背离'),colorff00ff;
h4:=hhv(gj,4);
gt2:=dea<ref(dea,1) and ref(dea,1)>ref(dea,2);
a2:=barslast(ref(gt2,1));
顶背离:= ref(h4,a2+1)<h4 and diff<ref(diff,a2+1) and gt2;
drawline(a2=0 ,dea,顶背离,ref(dea,a2),0),colorgreen,linethick2;
drawline(顶背离,dea,顶背离,ref(dea,a2),0),colorgreen,linethick2;
drawtext(顶背离,ref(dea,a2)*1.25,' 顶背离'),colorffff00;
a0:=diff<0 and dea<0;
a11:=a0>ref(a0,1);
a3:=barslast(a11);
a4:=count(dea>0 and diff >0,a3)=0;
a5:=cross(diff ,dea);
a6:=barslast(a5);
a7:=ref(a6,a6+1)+a6;
a8:=(diff+dea)/2;
a9:=(high+low)/2;
a10:=a5 and a7<a3 and a4 and a8>ref(a8,a7) and a9<ref(a9,a7) and macd>0;
drawtext(a10,diff*1.05,'白馬◆初现'),coloryellow;
dif:=ema(close,12)-ema(close,26),colorred,linethick1;
dea:ema(dif,9),coloryellow,linethick1;
持仓段:=0,color00cfff;
空仓段:=0,colorffccff;
stickline(((macd<ref(macd,1)) and (macd>0)),0,macd,1,0),colorliblue,linethick2;
stickline(((macd>ref(macd,1)) and (macd<0)),0,macd,1,0),colorff00ff,linethick2;
建仓:if(dif<0,dif,0),coloryellow,linethick1;
加仓:if(dif<0,0,dif),colorred,linethick1;
白线破仓:if(dif<dea,dif,dea),colorwhite,linethick1;
低位金叉:if(cross(dif,dea) and dif<-0.1,0.30,0),colorwhite,linethick1;
低位金叉:=cross(diff,dea) and diff<-0.1;
stickline(低位金叉,0,0.26,10,0),coloryellow;
drawtext(低位金叉,-0.50,' ◆低位★金叉'),colorwhite;
jccount:=count(cross(diff,dea),barslast(dea>=0));
零下二次金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)>0;
stickline(零下二次金叉,0,0.15,8,0),colorff00ff;
drawicon(零下二次金叉,dea*0.5,1) ;
drawtext(零下二次金叉,-0.30,' ◆零下二次金叉'),coloryellow;
drawtext(低位金叉 and 零下二次金叉 and 底背离,0.30,'◆三全项'),color0099ff,linethick2;
a0:=cross(diff,dea);///www.goodgongshi.com
a:=a0 and diff<0;
ft:=barslast(a);
b:=count(a0,ft);
高位金叉:diff>0 and dea>0 and a0 and b<2,coloryellow;
趋势强弱:if(dif>dea,dea,dea),colorff937f,linethick1;
stickline(高位金叉,0,0.40,8,0),coloryellow,linethick3;
stickline(高位金叉,0,0.21,7,0),colorff0000,linethick3;
drawtext(高位金叉,0.46,' ◆零上★金叉'),coloryellow;
drawline(a1=0,dea,底背离,dea,0),coloree00ee,linethick2;
drawline(a2=0,dea,顶背离,dea,0),colorffff00,linethick2;
drawtext(cross(dea,diff),diff+0.10,'▼死叉'),colorgreen;
mdj:=cross(dif,dea) and dea-0;
drawtext(mdj,dea-0.10,'▲金叉'),colorred;
drawicon(cross(diff,dea),dea,"buy");
drawicon(cross(dea,diff),diff,"sell");
dif:=ema(close,12)-ema(close,26);
dea:=ema(dif,9);
a1:= barslast(ref(cross(dif,dea),1));
零上二次金叉:=ref(dea,a1+1)>0 and dif>ref(dif,a1+1) and cross(dif,dea);
stickline(零上二次金叉,0,0.35,8,0),coloryellow;
drawicon(零上二次金叉,dea*-0.3,1) ;
drawtext(零上二次金叉,0.35,' ◆零上二次金叉'),coloryellow;
上一指标公式:大牙股东人数-自编-版指标公式详解 同花顺股东人数
下一指标公式:一阳指00指标公式详解 同花顺一阳指
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文背離MACD副图-波段趋势指标公式详解 同花顺MACD仅供学习研究。