//macd变色v4 +金叉买入指标公式
//20150328 diff上穿0轴后在0轴上第一次死叉后又金叉
//20150329 macd多头二次翻红
diff:ema(close,12) - ema(close,26),colorwhite,linethick1;
dea: ema(diff,9),coloryellow,linethick1;
macd: 2*(diff-dea),colorred,nodraw;
zero: 0,linethick1;
n:=if(barscount(c)<=5,ma(c,2),ma(c,5));
角度:((atan((n - ref(n,1))) * 3.1416) * 10),nodraw,colorlired;
//角度:((atan((ma(c,5) - ref(ma(c,5) ,1))) * 3.1416) * 10),nodraw;
流通股:shgzg/10000/10000,nodraw,colorff7f00;
资本金:gjj/zgb,nodraw;
//cci抄底
n:=14;
typ := (if(isnull(high),close,high) + if(isnull(low),close,low) + close)/3;
cci: (typ-ma(typ,n))/(0.015*avedev(typ,n)),colorffff00,nodraw;
//红色
stickline(macd>0 and macd>=ref(macd,1),0,macd,7,0),color0000ff;
//墨绿
stickline(macd>0 and macd<ref(macd,1),0,macd,3,0),colorffff00;
//洋红
stickline(macd<0 and macd>=ref(macd,1),0,macd,3,0),colorff00ff;
//绿色
stickline(macd<0 and macd<ref(macd,1),0,macd,7,0),color00ff00;
低位金叉:=cross(diff,dea) and diff<-0.2;
贴近零轴金叉:=cross(diff,dea) and macd>0 and between(diff,-0.03,0.03);
//verline(水上低位金叉,1),colorwhite;
//drawtext(低位金叉,diff*1.1,'低位'),color00aaff;
aa:=count(cross(diff,dea),barslast(dea>=0));
一次金叉:=cross(diff,dea) and dea<0 and count(aa=1,21)=1;
二次金叉:=cross(diff,dea) and dea<0 and count(aa=2,21)=1;
三次金叉:=cross(diff,dea) and dea<0 and count(aa=3,21)=1;
四次金叉:=cross(diff,dea) and dea<0 and count(aa=4,21)=1;
五次金叉:=cross(diff,dea) and dea<0 and count(aa=5,21)=1;
//verline(二次金叉,1),colorwhite;
drawtext(一次金叉,diff*1.1,'①'),color00aaff;
drawtext(一次金叉 and 低位金叉,diff*1.1,'①低位'),color00aaff;
drawtext(二次金叉,diff*1.1,'②'),color00aaff;
drawtext(二次金叉 and 低位金叉,diff*1.1,'②低位'),color00aaff;
drawtext(三次金叉,diff*1.1,'③'),color00aaff;
drawtext(三次金叉 and 低位金叉,diff*1.1,'③低位'),color00aaff;
drawtext(四次金叉,diff*1.1,'④'),color00aaff;
drawtext(四次金叉 and 低位金叉,diff*1.1,'④低位'),color00aaff;
drawtext(五次金叉,diff*1.1,'⑤'),color00aaff;
drawtext(五次金叉 and 低位金叉,diff*1.1,'⑤低位'),color00aaff;
//diff上穿0轴后在0轴上第一次死叉后又金叉 www.gszb.com
aa:= cross(diff,dea) and dea>0 ;
bb:=barslast(cross(dea,diff)) and dea>0;
cc:=ref(barslast(cross(diff,0))<20,barslast(cross(dea,diff))+1);
macd死叉后金叉:= aa and bb and cc;
drawtext(macd死叉后金叉,diff*1.1+0.1,'①'),colorred;
//macd多头二次翻红
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:=ema(c,30)>=ref(ema(c,30),1) and count(ema(c,5)>ema(c,10) and ema(c,10)>ema(c,30),1)=1;
fh4:=cross(c,ema(c,30)) or c>ema(c,30);
fh5:=fh1 and fh2 and fh3 and fh4;
fh6:=fh1 and fh2 and fh3 and fh4 and abs((diff-dea)/c)<0.018;
fh7:=fh1 and fh2 and fh3 and fh4 and macd<0.10;
macd多头二次翻红:=fh5 or fh6 or fh7;
drawtext(macd多头二次翻红 and ref(cci,1)<50,diff*1.1+0.05,'②'),colorred;
//这个"二次翻红"指标除了满足原有的四个条件外,即:
//一是macd在零轴以上并且第二次收红柱;
//二是macd红柱大于等于零轴并且红柱缩短小于0.10以下;(实战0.111也行)
//三是diff与dea两线的粘合度小于0.018;
//四是红柱连续缩短三天以上。
//还基本满足了所描述的四个条件(即:
//1、30日移动平均线由下跌变为走平或翘头向上,5日、10、30日移动平均线刚刚形成多头排列;
//2、日k线刚刚上穿30日移动平均线或在30日移动平均线上方运行;
//3、dif在零轴下方与macd金叉后可靠意义将会更大,在第一次翻红后,红柱开始缩短,越短越好,最好不要超过0轴的第一横线;
//4、成交量由萎缩逐渐放大,特别是在二次翻红后,若能得到成交量的配合,该股后市向上冲击的力量会更大。)
//该指标没有设计成交量这个条件。只要符合所涉及到的条件,就能在"二次翻红"起涨点选出股票。
a1:=barslast(ref(cross(diff,dea),1));
底背离:=ref(close,a1+1)>close and diff>ref(diff,a1+1) and cross(diff,dea);
a2:=barslast(ref(cross(dea,diff),1));
顶背离:=ref(close,a2+1)<close and ref(diff,a2+1)>diff and cross(dea,diff);
drawline(a1=0,dea,底背离,ref(dea,a1),0),colorred,linethick2;
drawline(底背离,dea,底背离,ref(dea,a1),0),colorred,linethick2;
drawtext(底背离,ref(dea,a1)*1.08,'+底背离'),colorff00ff;
drawline(a2=0 ,dea,顶背离,ref(dea,a2),0),colorgreen,linethick2;
drawline(顶背离,dea,顶背离,ref(dea,a2),0),colorgreen,linethick2;
drawtext(顶背离,ref(dea,a2)*1.12,'-顶背离'),colorcyan,linethick2;
//5日均线上穿24日均线
ma5:=ma(c,5);
ma24:=ma(c,24);
ll:=if(macd<=0,macd,-macd);
a1:=cross(ma5,ma24) or (ma5>ma24 and ref(ma5,1)<ref(ma24,1));
a2:=ma(v,10)<v;
a3:=if(macd<0,macd>=ref(macd,1),macd<3);
//五日内最大涨幅小于8%
a4:=c>=o and 角度<8 and count(c/o>1.08,5)<1;
//日线买点:= ma5>ma24 and ref(ma5,1)<ref(ma24,1) and cci<100;
日线买点:= a1 and a2 and a3 and a4;
drawicon(日线买点,ll*0.150,"5");
ma15=ma(c,15);
drawicon(cross(ma15,ma5),ma5*0.004,"6");
drawicon(cross(ma5,ma15),ma5*0.002,"9");
drawicon(cross(diff,dea),dea,"buy");
drawicon(cross(dea,diff),dea,"sell");
drawtext(cross(dea,diff),dea*0.55,'▼死叉'),colorgreen;
mdj:=cross(diff,dea) and dea-0;
drawtext(mdj,dea*1.35,'▲金叉'),colorred;
低位金叉:=cross(diff,dea) and diff<-0.1;
stickline(低位金叉,dea*0.86,dea*0.66,6,0),coloryellow;
drawtext(低位金叉,dea*0.86,' 低位金叉'),coloryellow;
jccount:=count(cross(diff,dea),barslast(dea>=0));
二次金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)=1;
stickline(二次金叉,dea*0.96,dea*0.76,6,0),colorff00ff;
drawicon(二次金叉,dea*1.6,'buy') ;
drawtext(二次金叉,dea*0.96,' 二次金叉'),colorred;
stickline(底背离,dea*1.09,dea*0.86,6,0),color00ff00;
a1:=barslast(ref(cross(diff,dea),1));
drawline(a1=0,dea,底背离,dea,0),colorff00ff,linethick2;
a2:=barslast(ref(cross(dea,diff),1));
drawline(a2=0,dea,顶背离,dea,0),colorcyan,linethick2;
x1:if(diff<0,diff,0),color0000ff,linethick2;
x2:if(diff<0,0,diff),colormagenta,linethick1;
x3:if(diff<dea,diff,dea),color00ff00,linethick1;
x4:if(diff>dea,dea,dea),linethick1,colorffbb11;
上一指标公式:新中线操盘指标公式详解 同花顺中线
下一指标公式:顾比均线1指标公式详解 同花顺均线
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文MACD优化指标公式详解 同花顺优化仅供学习研究。