SHORT:=6;
LONG:=16;
M:=5;
Zero : 0;
DIFF:EMA(C,SHORT)-EMA(C,LONG);
DEA:EMA(DIFF,M);
macd:2*(DIFF-DEA);
STICKLINE(MacD>=0,0,MACD,4,0),colorred;
STICKLINE(MACD<=0,0,MACD,4,0),colorgreen;
STICKLINE(MACD>=0 AND MACD
STICKLINE(MACD<=0 AND MACD>REF(MACD,1),0,MACD,4,0),colorcyan;
STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,8,0),colorred;
STICKLINE(MACD>=0 AND MACD<=REF(MACD,1),0,MACD,8,0),colorcyan;
STICKLINE(MACD<=0 AND MACD>=REF(MACD,1),0,MACD,8,0),colormagenta;
STICKLINE(MACD<=0 AND MACD<=REF(MACD,1),0,MACD,8,0),colorgreen;
强:IF(DIFF>=DEA,DIFF,DRAWNULL),colorred,LINETHICK1;
弱:IF(DEA>=DIFF,DEA,DRAWNULL),COLORFF9900,LINETHICK1;
X1:IF(diff<0,diff,0),COLOR0000FF,LINETHICK2;
X2:IF(diff<0,0,diff),colormagenta,LINETHICK1;
X3:IF(diff
低位金叉:=crOSS(DIFF,DEA) AND DIFF<-0.1;
STICKLINE(低位金叉,DEA*0.86,DEA*0.66,6,0),coloryellow;
DRAWTEXT(低位金叉,dea*0.86,' 低位金叉'),coloryellow;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BArslAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,DEA*0.96,DEA*0.76,6,0),ColorFF00FF;
DRAWICON(二次金叉,dea*1.1,'BUY') ;
DRAWTEXT(二次金叉,DEA*0.96,' 二次金叉'),ColorFF00FF;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,DEA*1.09,DEA*0.86,6,0),Color00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,linethick1;
DRAWTEXT(底背离,DEA*1.09,' 底背离'),Color6600FF;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)
DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen,linethick1;
DRAWTEXT(顶背离,DEA*1.2,' 顶背离'),Color00FF00;
量能饱和度:IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100),NODRAW;
换手率:vol/SHGZG*100;
A:=(3*C+L+O+H)/6;
X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+
14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210;
S2:=SMA(C,3,1);
S6:=SMA(C,5,1);
DK:=2*(S2-S6);
主力成本:EMA(X,13),colorwhite,LINETHICK0;