DIFF1:(EMA(CLOSE,12)-EMA(CLOSE,26))*10,COLORFFFFFF;
DEA1:EMA(DIFF1,9),COLORYELLOW;
JD:3*DIFF1-2*DEA1,COLORWHITE,LINETHICK2;
DRAWBAND(DIFF1,RGB(250,50,0),DEA1,RGB(50,250,0));
MACD1:=2*(DIFF1-DEA1);
MACD2:=SMA(MACD1,5,1);
STICKLINE(MACD1> MACD2 AND MACD1>0,0,MACD1,3,0),COLOR000055;
STICKLINE(MACD1> MACD2 AND MACD1>0,0,MACD1,2.5,0),COLOR000077;
STICKLINE(MACD1> MACD2 AND MACD1>0,0,MACD1,1.5,0),COLOR000099;
STICKLINE(MACD1> MACD2 AND MACD1>0,0,MACD1,1,0),COLOR0000FF;
STICKLINE(MACD1> MACD2 AND MACD1<0,0,MACD1,3,0),COLOR222222;
STICKLINE(MACD1> MACD2 AND MACD1<0,0,MACD1,2.5,0),COLOR444444;
STICKLINE(MACD1> MACD2 AND MACD1<0,0,MACD1,1.5,0),COLOR666666;
STICKLINE(MACD1> MACD2 AND MACD1<0,0,MACD1,0,0),COLOR999999;
STICKLINE(MACD1< MACD2,0,MACD1,3,0),COLORA80000;
STICKLINE(MACD1< MACD2,0,MACD1,2.5,0),COLORB80000;
STICKLINE(MACD1< MACD2,0,MACD1,1.5,0),COLOREC1000;
STICKLINE(MACD1< MACD2,0,MACD1,1,0),COLORFF4600;
STICKLINE(MACD1< MACD2,0,MACD1,0,0),COLORFFAA00;
低位金叉:=CROSS(DIFF1,DEA1) AND DIFF1<-0.1;
STICKLINE(低位金叉,0,DIFF1,3,0),COLOR002222;
STICKLINE(低位金叉,0,DIFF1,2.5,0),COLOR006666;
STICKLINE(低位金叉,0,DIFF1,1.5,0),COLOR009999;
STICKLINE(低位金叉,0,DIFF1,1,0),COLOR00FFFF;
DRAWTEXT(低位金叉,0.1,' 低位金叉'),COLOR00FF88;
JCCOUNT:=COUNT(CROSS(DIFF1,DEA1),BARSLAST(DEA1>=0));
二次金叉:=CROSS(DIFF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,MACD1,-0.01,3,0),COLOR440044;
STICKLINE(二次金叉,MACD1,-0.01,2.5,0),COLOR660066;
STICKLINE(二次金叉,MACD1,-0.01,1.5,0),COLOR990099;
STICKLINE(二次金叉,MACD1,-0.01,1,0),COLORFF00FF;
DRAWTEXT(二次金叉,DEA1*1.3,' 二次金叉'),COLORYELLOW;
A1:=BARSLAST(REF(CROSS(DIFF1,DEA1),1));
底背离:=REF(CLOSE,A1+1)> CLOSE AND DIFF1> REF(DIFF1,A1+1) AND CROSS(DIFF1,DEA1),NODRAW;
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
DRAWLINE(A1=0,DEA1,底背离,DEA1,0),COLORRED;
DRAWTEXT(底背离,DEA1,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA1,DIFF1),1));
顶背离:=REF(CLOSE,A2+1)< CLOSE AND REF(DIFF1,A2+1)>DIFF1 AND CROSS(DEA1,DIFF1),NODRAW;
DRAWLINE(A2=0,DEA1,顶背离,DEA1,0),COLORFF8800;
DRAWTEXT(顶背离,DEA1,' 顶背离'),COLORFFFF00;
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,DEA1*1.1,'三全项'),COLOR0000FF;
微分:=SMA(MACD1,5,1),LINETHICK2,COLORMAGENTA;
力度:(MACD1-MACD2)*2,COLORYELLOW,LINETHICK2;
力10:EMA(力度,5),COLORCYAN,LINETHICK2;
力55:EMA(力度,55),COLORRED,LINETHICK2;
VAR14:=ZIG(3,13);
小苹果:IF((REF(VAR14,2)> REF(VAR14,1)) AND (VAR14> REF(VAR14,1)),1,0),NODRAW;
DRAWICON ((REF(VAR14,2)> REF(VAR14,1)) AND (VAR14> REF(VAR14,1)),MACD1,16);{小苹果}
金手指:ZIG(3,10)> REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)< REF(ZIG(3,10),2),NODRAW;
DRAWICON (金手指=1,MACD1*0.96,11);