{★macd-(快速)}
input: p(19,15,100), s(7,5,140), m(9,2,80);
{-----------------------☆功能开关------------------------}
{资金}
zj1:=dma((h+l+c*2)/4,0.9); zj2:=v/((h-l)*2-abs(c-o));
zj3:=if(c>o,zj2*(h-l),if(c<o,zj2*(h-o+(c-l)),v/2))+if(c>o,0-zj2*(h-c+(o-l)),if(c<o,0-zj2*(h-l),0-v/2));
zj4:=zj3/20/1.15; zj5:=zj4*0.55+ref(zj4,1)*0.33+ref(zj4,2)*0.22; zj6:=ema(zj5,3);
{macd}
mj_1 := ema(close,s) - ema(close,p);
mj_2 := ema(mj_1,m);
mj_3 := 2*(mj_1-mj_2);
mj_4:=reverse(mj_3)+2*wma(wma(mj_3,1),5);
mj_5:=3*mj_4-2*sma(mj_4,2,1);
{形态}
低金:=cross(mj_1,mj_2) and mj_1<-0.1;{低金}
sa0:=count(cross(mj_1,mj_2) and mj_2<0,21)=3;
零下二次金叉:=cross(mj_3,0) and sa0;{零下二次金叉}
sa1:=count(cross(mj_1,mj_2),barslast(mj_2>=0));
二金:=(cross(mj_1,mj_2) and mj_2<0 and count(sa1=2,21)=1)*2;{二次金叉}
sa2:=barslast(ref(cross(mj_1,mj_2),1));
底背:=(ref(c,sa2+1)>c and mj_1>ref(mj_1,sa2+1) and cross(mj_1,mj_2))*3;{底背}
三全:=低金 and 二金 and 底背;
sa3:=barslast(ref(cross(mj_2,mj_1),1));
顶背:=ref(c,sa3+1)<c and ref(mj_1,sa3+1)>mj_1 and cross(mj_2,mj_1);{顶背}
{信号}
m_c1:=ema(c,5)/ema(ema(c,9),16)<=0.85 and c/ref(c,1)<1.05 and c/ref(c,1)>0.905 and v/capital*100<5;
m_c2:=min(ref(c,2)*0.865,ref(c,13)*0.772); m_c3:=(c-m_c2)/c<0.03; 满仓:=m_c1 and m_c3;
{估测转折股价--未来}
x:=barslast(backset(islastbar,1)=1)+1;
z_1:=ref(mj_2,1)+((m+1)/(2*(m-1)))*ref(mj_3,1);
z_2:=((p-1)*(s+1)*ref(ema(c,p),1)-(p+1)*(s-1)*ref(ema(c,s),1)+(s+1)*(p+1)*ref(mj_1,1))/(2*p-2*s);
z_3:=((p-1)*(s+1)*ref(ema(c,p),1)-(p+1)*(s-1)*ref(ema(c,s),1)+(s+1)*(p+1)*ref(mj_2,1))/(2*p-2*s);
z_4:=((p-1)*(s+1)*ref(ema(c,p),1)-(p+1)*(s-1)*ref(ema(c,s),1)+(s+1)*(p+1)*z_1)/(2*p-2*s);
y_1:=(mj_2*x+((m+1)/(2*(m-1)))*mj_3*x);
y_2:=((p-1)*(s+1)*ema(c,p)*x-(p+1)*(s-1)*ema(c,s)*x+(s+1)*(p+1)*mj_1*x)/(2*p-2*s);
y_3:=((p-1)*(s+1)*ema(c,p)*x-(p+1)*(s-1)*ema(c,s)*x+(s+1)*(p+1)*mj_2*x)/(2*p-2*s);
y_4:=((p-1)*(s+1)*ema(c,p)*x-(p+1)*(s-1)*ema(c,s)*x+(s+1)*(p+1)*y_1)/(2*p-2*s);
{-----------------【图解模板】---------------------}
drawgbk(c,colorrgb(36,68,36),colorrgb(100,100,100),1);
{macd}
fillrgn(mj_1>=mj_2,mj_1,mj_2),color689aff;
fillrgn(mj_1<mj_2,mj_2,mj_1),colorffc000;
fillrgn(mj_3>mj_5,mj_5,mj_3),colorffb7ff;
fillrgn(mj_3<mj_5,mj_5,mj_3),color003e00;
stickline(mj_3<ref(mj_3,1) and mj_3<0,0,mj_3,0,0),colorffcf78;{蓝}
stickline(mj_3<ref(mj_3,1) and mj_3>0,0,mj_3,0,0),coloryellow;{黄}
stickline(mj_3>ref(mj_3,1) and mj_3<0,0,mj_3,0,0),coloraf00af;{紫}
stickline(mj_3>ref(mj_3,1) and mj_3>0,0,mj_3,0,0),colorred;{红}
diff: mj_1,precision2,colorwhite;
dea: mj_2,precision2,coloryellow;
加速:2.8*(mj_2-mj_1),linethick,precision2,colorgreen;
partline(range(barpos,sysparam(3)-34,sysparam(3)+1),加速),linedot,colorgreen;
多头: mj_3,linethick2,precision2,colorred;
预警:mj_5,precision2,colorff8900,colorffb500;
partline(mj_1>=ref(mj_1,1) and mj_2<ref(mj_2,1),mj_1),linethick2,colormagenta;//粉
partline(mj_1<ref(mj_1,1) and mj_2>ref(mj_2,1),mj_1),linethick2,colorblue;//蓝
{资金}
partline(1,0),linethick2,colorwhite;//负
partline(zj6>=0,0),linethick2,colorred;//正
{形态}
drawtext(低金,dea*0.98,'▲'),pxdn8,color00c300;
drawtext(零下二次金叉,dea*0.98,'▲ \n▲'),pxdn8,color00c300;
drawtext(二金,dea*0.98,'▲ \n▲'),pxdn8,color00c300;
drawtext(底背,dea*0.98,' \n \n↑'),pxdn8,colormagenta;
drawtext(三全,dea*0.98,'▲ \n▲ \n▲'),pxdn8,colorred;
drawtext(顶背,dea,'▼ \n▼'),pxup60,colorff5b00;
{信号}
vertline(满仓),linedot,colorgray;
drawtext(满仓,加速,' 第 \n 二 \n 天 \n 买 \n'),align,coloryellow;
drawicon(满仓,mj_1*0.96,1),align,pxdn10;//多空差:34.47 成功率:83.08%
{估测转折股价--未来}
drawtextex(sysparam(3)=barpos,0,6,2,'今日diff转折: '+numtostr(z_2,2)),colorgreen;
drawtextex(sysparam(3)=barpos,0,6,20,'今日dea转折: '+numtostr(z_3,2)),colorgreen;
drawtextex(sysparam(3)=barpos,0,6,38,'今日macd转折:'+numtostr(z_4,2)),colorgreen;
drawtextex(sysparam(3)=barpos,0,6,94,'明日diff转折: '+numtostr(y_2,2)),coloryellow;
drawtextex(sysparam(3)=barpos,0,6,112,'明日dea转折: '+numtostr(y_3,2)),coloryellow;
drawtextex(sysparam(3)=barpos,0,6,130,'明日macd转折: '+numtostr(y_4,2)),coloryellow;
换手:if(capital=0,v/sum(v,100)*100,v/finance(7)),precision2,linethick,colorgray;
涨跌幅:(c-ref(c,1))/ref(c,1)*100,precision2,linethick,colorgray;
{取参数}
gdt2:=finance(0);//报表最新日期
xxx:=strtonum(strright(numtostr(finance(0),0),2));//取右两位数
nn:=if(xxx>11 or xxx<3,1,if(between(xxx,2.9,6),4,if(between(xxx,5.9,9),2,4/3))),linethick;
市赢率:c/(finance(33)*nn),precision2,linethick,colorgray;
市净率:c/finance(34),precision2,linethick,colorgray;
//
上一指标公式:探索金叉公式 飞狐探索指标 源码
下一指标公式:鹰派波段版本江南鹰眼公式 飞狐江南指标 源码
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文★MACD-快速公式 飞狐MACD指标 源码仅供学习研究。