diff : ema(close,12) - ema(close,26);
dea : ema(diff,9);
macd=2*(diff-dea);
zero : 0,color000080;
gj:=max(c,o);
macdb:2*(diff-dea),colorstick;
bv:=sum(macdb,0),nodraw;
ba:=if(max(bv,ref(bv,2))<ref(bv,1) or min(bv,ref(bv,2))>ref(bv,1),1,0);
bc:=barslast(ba)+1;
smacd:=bv-ref(bv,bc);
var3:=if(macdb>0,hhv(abs(macdb),bc),llv(macdb,bc));
var4:=(macdb)/20;//www.goodgongshi.com
stickline(macd>0 and macd>=ref(macd,1),0,macd,2,0),colorred;
stickline(macd>0 and macd<ref(macd,1),0,macd,2,0),color000099;
stickline(macd<0 and macd>=ref(macd,1),0,macd,2,0),color0a6f00;
stickline(macd<0 and macd<ref(macd,1),0,macd,2,0),color00ff00;
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,linethick1;
drawline(底背离,dea,底背离,ref(dea,a1),0),colorred,linethick1;
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),color004700,linethick1;
drawline(顶背离,dea,顶背离,ref(dea,a2),0),color004700,linethick1;
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;
红面积:sum(macd,barslast(macd<0))*(macd>0),color0000ff,nodraw;
绿面积:sum(macd,barslast(macd>0))*(macd<0),colorffff00,nodraw;
aa:=round((ref(绿面积,1)*100),0);bb:=round((ref(红面积,1)*100),0);
低位金叉:=cross(diff,dea) and diff<-0.1;
jccount:=count(cross(diff,dea),barslast(dea>=0));
二次金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)=1;
a1:=barslast(cross(diff,dea));
a2:=barslast(cross(dea,diff));
a3:=barslast(cross(diff,dea),1);
a4:=barslast(cross(dea,diff),1);
底背离:= llv(close,a2)<ref(llv(close,a4-a3),a3) and llv(diff,a2)>ref(llv(diff,a4-a3),a3) and cross(diff,dea);
drawline(ref(cross(diff,dea),1),dea,底背离,dea,0),colorred,linethick1;
顶背离:= hhv(close,a1)>ref(hhv(close,a3-a4),a4) and hhv(diff,a1)<ref(hhv(diff,a3-a4),a4) and cross(dea,diff);
drawline(ref(cross(dea,diff),1),dea,顶背离,dea,0),color004700,linethick1;
drawtext(低位金叉 and 二次金叉 and 底背离,0.25,'三全项'),color0000ff,linethick1;
select 底背离;
jc := dea-diff;
绿柱面积:=if(macd<0,sum(macd,barslast(jc<0)),0);
红柱面积:=if(macd>0,sum(macd,barslast(jc>0)),0);
本次最低价:=llv(l,barslast(jc<0));
本次最高价:=hhv(h,barslast(jc>0));
x1:=if (macd<0,barslast(cross(diff,dea)),0);
前次绿柱面积:=ref(绿柱面积,x1+1);
前次最低价:=ref(本次最低价,x1+1);
y1:=if((绿柱面积<0 and abs(绿柱面积)<abs(前次绿柱面积)
and 本次最低价<前次最低价 ),1,0);
rs1:= macd<0 and ref(macd,1)<0 and c<前次最低价
and abs(绿柱面积)<abs(前次绿柱面积) and abs(macd)<abs(ref(macd,1));
底背驰:= if (cross(diff,dea),ref(y1,1),0);
stickline(底背驰,0,-0.01,4,0),color0000ff;
x2:=if (macd>0,barslast(cross(dea,diff)),0);
前次红柱面积:=ref(红柱面积,x2+1);
前次最高价:=ref(本次最高价,x2+1);
y2:=if((红柱面积>0 and 红柱面积<前次红柱面积 and 本次最高价>前次最高价 ),1,0);
rs2:= macd>0 and ref(macd,1)>0 and c>前次最高价 and abs(红柱面积)<abs(前次红柱面积) and abs(macd)<abs(ref(macd,1));
顶背驰:= if (cross(dea,diff),ref(y2,1),0);
stickline(顶背驰,0,0.01,4,0),color00ff00;
贪:if(diff>=dea,diff,drawnull),colorwhite;
痴:if(dea>=diff,dea,drawnull),coloryellow;
慢:if(diff>=dea,dea,drawnull),color0099ff;
疑:if(dea>=diff,diff,drawnull),color999999;
嗔:diff-dea,colormagenta,nodraw;
verline(底背驰,1),color003bc1;
verline(顶背驰,1),color007800;
verline(hour<ref(hour,1),2),color00174d;
面积1:=round(smacd*100),nodraw;
面积:smacd*100,nodraw;
面积数字高度:=ref(var3,1)*0.9;
drawnumber(ref(var4,1)>0 and var4<=0 ,ref(var3,1)*0.9,ref(面积1,1)),colorlired;
drawnumber(ref(var4,1)<0 and var4>=0 ,ref(var3,1)*0.9,ref(abs(面积1),1)),colorgreen;
drawnumber(islastbar and var4<0,ref(var3,1)*0.9,abs(面积1)),colorwhite;
drawnumber(islastbar and var4>0,ref(var3,1)*0.9,面积1),colorwhite;
m1:=ref(macdb,1);
if(diff>=ref(diff,1),diff,drawnull),colorgreen,linethick2;
上一指标公式:ZFL指标公式详解 同花顺ZFL
下一指标公式:大买主升浪指标公式详解 同花顺买主
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文MACD面积指标公式详解 同花顺面积仅供学习研究。