顶背离、底背离均画线和文字标注,有变色和低位金叉及二次金叉,飞狐可以用来选股,希望大家喜欢!

源码

DIF1:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA1:=EMA(DIF1,9);
MACD1:=2*(DIF1-DEA1);MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,8,0),COLOR000055;
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,5,0),COLOR000077;
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,3,0),COLOR000099;
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLOR0000FF;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,8,0),COLOR555555;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,5,0),COLOR777777;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,3,0),COLOR999999;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORFFFFFF;
STICKLINE(MACD1<MACD2,0,MACD1,8,0),COLORB20000;
STICKLINE(MACD1<MACD2,0,MACD1,5,0),COLOREC0000;
STICKLINE(MACD1<MACD2,0,MACD1,3,0),COLORFF4600;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORFFAB00;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
低位金叉:=CROSS(DIF1,DEA1) AND DIF1<-0.1;
STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;
DRAWTEXT(低位金叉,0.16,’ 低位金叉’),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BARSLAST(DEA1>=0));
二次金叉:=CROSS(DIF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;
DRAWICON(二次金叉,DEA1*0.9,1) ;
DRAWTEXT(二次金叉,0.2,’ 二次金叉’),COLORYELLOW;
DIF:DIF1,COLOR33FF33;
DEA:DEA1,COLORYELLOW;
MACD:MACD1,LINETHICK,COLORMAGENTA;
强度:PARTLINE(DIF1>=DEA1,DIF1),COLORRED,LINETHICK2;
A1:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF1>REF(DIF1,A1+1) AND CROSS(DIF1,DEA1);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA1,底背离,DEA1,0),COLORRED,LINETHICK3;
DRAWTEXT(底背离,0.12,’ 底背离’),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA1,DIF1),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF1,A2+1)>DIF1 AND CROSS(DEA1,DIF1);
顶背:DRAWLINE(A2=0,DEA1,顶背离,DEA1,0),COLORGREEN,LINETHICK3;


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。