不多说,有经验的人一看就明白。
macd实战
{short:1,999,12}
{long:1,999,26}
{mid:1,999,9}
diff:ema(c,short)-ema(c,long);
dea:ema(diff,mid);
macd:(diff-dea)*2,colorffff00,colorstick;
a1:=barslast(ref(cross(0, dea),1));
a2:= barslast(ref(count(dea<=0,a1+1)=a1+1 and llv(diff,5)=llv(diff,a1+1) and cross(diff,dea),1));
a3:= barslast(ref(cross(diff,dea),1));
dibl1:=llv(c,a3+1)=llv(c,a1+1) and not(llv(diff,a3+1)=llv(diff,a1+1)) and count(dea<=0,a2+1)=a2+1 and cross(diff,dea);
金叉:if(cross(diff,dea) and dea<=0 and dibl1=0,0,dea),coloryellow;
底背离:if(dibl1,0,dea),colorred;
b1:=barslast(ref(cross(dea,0),1));
b2:=barslast(ref(count(dea>=0,b1+1)=b1+1 and hhv(diff,5)=hhv(diff,a1+1) and cross(dea,diff),1));
b3:=barslast(ref(cross(dea,diff),1));
dingbl1:= hhv(c,b3+1)=hhv(c,b1+1) and not(hhv(diff,b3+1)=hhv(diff,b1+1)) and count(dea>=0,b2+1)=b2+1 and cross(dea,diff);
死叉:if(cross(dea,diff) and dea>=0 and dingbl1=0,0,dea),colorffff00;
顶背离:if(dingbl1,0,dea),colorgreen;
dibjg:=llv(c,a3+1)=llv(c,a1+1) and not(llv(diff,a3+1)=llv(diff,a1+1)) and diff>ref(diff,1) and count(dea<=0,a2+1)=a2+1 and diff<dea ;
dingbjg:=hhv(c,b3+1)=hhv(c,b1+1) and not(hhv(diff,b3+1)=hhv(diff,b1+1)) and ref(diff,1)>diff and count(dea>=0,b2+1)=b2+1 and diff>dea ;
stickline(dibjg =1 ,dea,diff,2,0),colorred;
stickline(dingbjg =1 ,dea,diff,2,0),colorgreen;
mb:=ema(diff,20);
ub:=mb+1.9104*std(diff,20);
lb:=mb-1.9104*std(diff,20);
zjs:=hhv(dea,b1+1)/2;
zjx:=llv(dea,a1+1)/2;
stickline(dea>diff and dea>0 and dea>zjs, zjs,ref(zjs,1),1,0), colorred;
stickline(dea<diff and dea<0 and dea<zjx,zjx, ref(zjx,1),1,0),colorgreen;
{macd自定周期}
{short:1,999,12}
{lonng:1,999,26}
{mid:1,999,9}
{m:2,999,4}
diff:ema(c,short*m)-ema(c,long*m);
dea:ema(diff,mid*m);
macd:(diff-dea)*2,colorffff00,colorstick;
a1:=barslast(ref(cross(0, dea),m));
a2:=barslast(ref(dea<0 and cross(diff,dea),m));
a3:=barslast(ref(count(dea<0,a2+m)=a2+m and cross(diff,dea),m));
a4:=llv(c,a3+m)<ref(llv(c,a2+m),a3+m) and llv(diff,a3+m)>=ref(llv(diff,a2+m),a3+m);
a5:=llv(c,a2+m)<ref(llv(c,a1+m),a2+m) and llv(diff,a2+m)>=ref(llv(diff,a1+m),a2+m);
dibl1:=(a4=1 or a5=1) and count(dea<0,a2+m)=a2+m and dea<0 and cross(diff,dea);
金叉:if(cross(diff,dea) and dea<=0 and dibl1=0,0,dea),coloryellow;
底背离:if(dibl1=1,0,dea),colorred;
b1:=barslast(ref(cross(dea,0),m));
b2:=barslast(ref(dea>0 and cross(dea,diff),m));
b3:=barslast(ref(count(dea>0,b2+m)=b2+m and cross(dea,diff),m));
b4:=hhv(c,b3+m)>ref(hhv(c,b2+m),b3+m) and hhv(diff,b3+m)<=ref(hhv(diff,b2+m),b3+m);
b5:=hhv(c,b2+m)>ref(hhv(c,b1+m),b2+m) and hhv(diff,b2+m)<=ref(hhv(diff,b1+m),b2+m);
dingbl1:=(b4=1 or b5=1) and count(dea>=0,b2+m)=b2+m and dea>=0 and cross(dea,diff);
死叉:if(cross(dea,diff) and dea>=0 and dingbl1=0,0,dea),colorwhite;
顶背离:if(dingbl1=1,0,dea),colorgreen;
dibjg:=(a4=1 or a5=1) and count(dea<0,a2+m)=a2+m and dea<0 and diff>ref(diff,m) and
diff>ref(diff,8) and diff<dea ;
dingbjg:=(b4=1 or b5=1) and count(dea>=0,b2+m)=b2+m and dea>=0 and ref(diff,m)>diff and
ref(diff,8)>diff and diff>dea ;
stickline(dibjg =1 ,dea,diff,2,0),colorred;
stickline(dingbjg =1 ,dea,diff,2,0),colorgreen;
mb:=ema(diff,20*m);
ub:=mb+1.9104*std(diff,20*m);
lb:=mb-1.9104*std(diff,20*m);
zjs:=hhv(dea,b1+m)/2;
zjx:=llv(dea,a1+m)/2;
stickline(dea>diff and dea>0 and dea>zjs,zjs,ref(zjs,m),1,0),colorred;
stickline(dea<diff and dea<0 and dea<zjx,zjx,ref(zjx,m),1,0),colorgreen;
上一指标公式:先知解盘主图 通达信先知
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文自己用的实战型macd-MACD实战MACD自定周期 通达信周期自定仅供学习研究。