DIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA1:=EMA(DIF1,9);
MACD1:=2*(DIF1-DEA1),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORF00FF0;
STICKLINE(MACD1
DIFF:DIF1,COLOR33FF33;
DEA:DEA1,COLORYELLOW;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIF1>=DEA1,DIF1,DRAWNULL),COLORRED,LINETHICK2;
低位金叉:= CROSS(DIFF,DEA) AND DIFF<(-0.1);
STICKLINE(低位金叉,0,-0.3,1,0),COLOR00FFFF;
DRAWTEXT(低位金叉,-0.3,' 低位金叉'),COLOR00FFFF;
JCCOUNT:= COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:= CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.15,1,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*1.04,1),COLOR0000FF;
DRAWTEXT(二次金叉,-0.15,' 二次金叉'),COLORFF00FF;
A1:= BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:= REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.15,1,0),COLOR00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),LINETHICK3,COLORWHITE;
DRAWTEXT(底背离,0.15,' 底背离'),COLOR00FF00;
A2:= BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:= REF(CLOSE,A2+1)
DRAWLINE(A2=0,DEA,顶背离,DEA,0),LINETHICK3,COLORBLUE;
AA:=C>REF(C,4);
NT:=BARSLASTCOUNT(AA);
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;
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(DEA1,DIF1),DEA1,2);
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!