macd四色定量结构优化
在定量结构的基础上优化而成的指标!
包含:
①顶底背离提示
②高九,低九提示
③macd买卖点提示
④macd拐点变色提示
drawgbk(o>c,rgb(40,40,40),rgb(0,0,40),0,'01',0); {背景不要可删除}
dif:100*(ema(close,12)-ema(close,26)),colorwhite,linethick1;
dea:ema(dif,9),coloryellow,linethick1;
macd:(dif-dea)*2,colorstick;
{好公式网-最好的股票公式网站 www.goodgongshi.com}
stickline(macd>ref(macd,1)and macd>0,0,macd,0.2,0),colorred;
stickline(macd<ref(macd,1)and macd>0,0,macd,0.2,0),coloryellow;
stickline(macd>ref(macd,1)and macd<0,0,macd,0.2,0),colorblue;
stickline(macd<ref(macd,1)and macd<0,0,macd,0.2,0),colorgreen;
fh1:=ref(macd,1)<ref(macd,2) and ref(macd,2)<ref(macd,3) and ref(macd,3)<ref(macd,4);
fh2:=macd>=0 and count(macd>ref(macd,1),1)=1;
fh3:=fh1 and fh2 and ema(c,13)>ref(ema(c,13),1);
fh4:=fh1 and fh2 and abs((dif-dea)/c)<0.018;
fh5:=fh1 and fh2 and macd<0.10;
二次翻红:(fh3 or fh4 or fh5),colorred,nodraw;
低买:cross(dif,dea) and dif<0,colorff00ff,nodraw;
加油:cross(dif,dea) and dif>0,coloryellow,nodraw;
drawicon(二次翻红,-0.05,1);
drawtext(二次翻红,-0.15,'↖翻红'),colorred;
drawtext(cross(dif,dea) and dif<0,dea-0.02,'↖低买'),colorff00ff;
drawtext(cross(dif,dea) and dif>0,dea-0.05,'↖加油'),coloryellow;
xg:二次翻红 or 低买 or 加油,nodraw;
ylzc:=if(close=indexc,(indexc+indexh+indexl+indexo)/4,amount/(vol+0.01)/100);
a1:=c>ref(c,4);
nt:=barslastcount(a1);
tj11:=nt=9;
tj13:=islastbar and between(nt,5,8);
ay:=(backset(tj11>0,9) or backset(tj13>0,nt))*nt;
drawtext(ay>0,macd*1.02,var2str(ay,0)),colorlired;
drawtext(nt=9,macd*1.02,'9'),colorgreen;
b1:=c<ref(c,4);
nt0:=barslastcount(b1);
tj21:=nt0=9 ;
tj23:=islastbar and between(nt0,5,8);
ay1:=(backset(tj21>0,9) or backset(tj23>0,nt0))*nt0;
drawtext(ay1>0,macd*0.98,var2str(ay1,0)),colorgreen;
drawtext(nt0=9,macd*0.98,'9'),colorred;
drawicon(cross(dif,dea),dea,1);
drawicon(cross(dea,dif),dea,2);
死叉:=cross(dea,dif);
n1:=barslast(死叉),nodraw;{最近一次死叉的位置}
n2:=ref(barslast(死叉),n1+1),nodraw;{倒数第二次死叉与倒数第一次死叉的区间}
n3:=ref(barslast(死叉),n2+n1+2),nodraw;{倒数第三次死叉与倒数第二次死叉的区间}
cl1:=llv(c,n1+1),nodraw;{最近一次死叉后,最低收盘价}
difl1:=llv(dif,n1+1),nodraw;
cl2:=ref(cl1,n1+1),nodraw;{倒数第二次死叉与倒数第一次死叉之间的最低收盘价}
difl2:=ref(difl1,n1+1),nodraw;
cl3:=ref(cl2,n1+1),nodraw;{倒数第三次死叉与倒数第二次死叉之间的最低收盘价}
difl3:=ref(difl2,n1+1),nodraw;
pdifl2:=if(difl2>0,intpart(log(difl2))-1,intpart(log(-difl2))-1);
mdifl2:=intpart(difl2/pow(10,pdifl2));
pdifl3:=if(difl3>0,intpart(log(difl3))-1,intpart(log(-difl3))-1);
mdifl3:=intpart(difl3/pow(10,pdifl3));
mdifb2:=intpart(dif/pow(10,pdifl2));
mdifb3:=intpart(dif/pow(10,pdifl3));
直接底背离:=(cl1<cl2 ) and (mdifb2>mdifl2) and (macd<0 and ref(macd,1)<0) and mdifb2<=ref(mdifb2,1);
隔峰底背离:=(cl1<cl3 and cl3<cl2 ) and (mdifb3>mdifl3) and (macd<0 and ref(macd,1)<0) and mdifb3<=ref(mdifb3,1);
底部钝化:直接底背离 or 隔峰底背离,nodraw;
底背离:((mdifb2>ref(mdifb2,1))*ref(直接底背离,1)) or ((mdifb3>ref(mdifb3,1))*ref(隔峰底背离,1)),nodraw;
{drawtext(tfilter(b,(ref(dif,1)>ref(dif,2) and dif<ref(dif,1)),1),difl2,'钝化开始'),coloryellow;}
stickline(底部钝化,dif,dea,1,0),colorred;
drawtext(tfilter(底背离,c<ref(cl1,1),1),dif*0.98,'底部结构形成'),colormagenta;
金叉:=cross(dif,dea);
m1:=barslast(金叉),nodraw;{最近一次金叉的位置}
m2:=ref(barslast(金叉),m1+1),nodraw;{倒数第二次金叉与倒数第一次金叉的区间}
m3:=ref(barslast(金叉),m2+m1+2),nodraw;{倒数第三次金叉与倒数第二次金叉的区间}
ch1:=hhv(c,m1+1),nodraw;{最近一次金叉后,最高收盘价}
difh1:=hhv(dif,m1+1),nodraw;
ch2:=ref(ch1,m1+1),nodraw;{倒数第二次金叉与倒数第一次金叉之间的最高收盘价}
difh2:=ref(difh1,m1+1),nodraw;
ch3:=ref(ch2,m1+1),nodraw;{倒数第三次金叉与倒数第二次金叉之间的最高收盘价}
difh3:=ref(difh2,m1+1),nodraw;
pdifh2:=if(difh2>0,intpart(log(difh2))-1,intpart(log(-difh2))-1);
mdifh2:=intpart(difh2/pow(10,pdifh2));
pdifh3:=if(difh3>0,intpart(log(difh3))-1,intpart(log(-difh3))-1);
mdifh3:=intpart(difh3/pow(10,pdifh3));
mdift2:=intpart(dif/pow(10,pdifh2));
mdift3:=intpart(dif/pow(10,pdifh3));
直接顶背离:=(ch1>ch2 ) and (mdift2<mdifh2) and (macd>0 and ref(macd,1)>0) and mdift2>=ref(mdift2,1);
隔峰顶背离:=(ch1>ch3 and ch3>ch2 ) and (mdift3<mdifh3) and (macd>0 and ref(macd,1)>0) and mdift3>=ref(mdift3,1);
顶部钝化:直接顶背离 or 隔峰顶背离,nodraw;
顶背离:((mdift2<ref(mdift2,1))*ref(直接顶背离,1)) or ((mdift3<ref(mdift3,1))*ref(隔峰顶背离,1)),nodraw;
{drawtext(tfilter(t,(ref(dif,1)<ref(dif,2) and dif>ref(dif,1)),1),difh2,'钝化开始'),coloryellow;}
stickline(顶部钝化,dif,dea,1,0),colorgreen;
drawtext(tfilter(顶背离,c>ref(ch1,1),1),dif*1.02,'顶部结构形成'),colormagenta;
drawicon(cross(dif,dea),dea,36);
drawicon(cross(dea,dif),dea,37);
macddif:=if(abs(macd)>abs(dif),macd,dif);
drawicon(ref(dif,1)>ref(dif,2) and dif<ref(dif,1) and dif>0 and dif>dea,macddif*1.1,39),colorgreen;
drawicon(ref(dif,1)<ref(dif,2) and dif>ref(dif,1) and dif<0 and dif<dea,macddif*1.1,38),colorred;
上一指标公式:金针探底选股指标选股版下载 通达信金针探底公式
下一指标公式:极冰神火选股(主副图源码)下载 通达信选股源码
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文MACD四色定量结构优化副图指标下载 通达信源码仅供学习研究。