{波段Z}
MA5:MA(C,5);
MA10:MA(C,10);
MA20:MA(C,20);
MA30:MA(C,30);
VAR1:=(CLOSE*2+HIGH+LOW)/4;{当日股价中线}
SK:=EMA(VAR1,13)-EMA(VAR1,73);{13日均线-73日均线,求差}
SD:=EMA(SK,2);{SK的2日均线}
DX1:=CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)*100>=3;
{SK与SD低位金叉,当日涨幅大于+3%}
DX2:=CROSS(SK,SD) AND SK<=-0.14;{SK与SD超跌低位金叉}
DX3:=CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2 OR (C-REF(C,1))/REF(C,1)*100>=3.5);
{SK与SD中位金叉,并且放量上涨。(当日量大于5日均量2倍,或者涨幅大于+3.5%)}
短线:=(DX1 OR DX2 OR DX3)*0.5,POINTDOT,COLOR00FF00;{满足条件DX1/DX2/DX3之一,设定为短线买入条件。}
买入:=(CROSS(SK,SD) AND BARSLAST(CROSS(SD,SK))>=8)*0.2,POINTDOT,COLORWHITE,LINETHICK0;
加码:=(CROSS(SK,SD) AND BARSLAST(CROSS(SD,SK))<8)*0.3,POINTDOT,COLORYELLOW,LINETHICK0;
{以下设置主图显示方式}
DRAWTEXT(短线>0 ,L*0.99,'短线'),COLORWHITE;
STICKLINE(短线>0,H,L,1,0),LINETHICK2,COLORRED;
STICKLINE(短线>0,O,C,4,1),LINETHICK2,COLORRED;
DRAWTEXT(买入>0 ,L*0.99,'买入'),COLORYELLOW;
STICKLINE(买入>0,H,L,1,0),LINETHICK2,COLORWHITE;
STICKLINE(买入>0,O,C,4,1),LINETHICK2,COLORWHITE;
DRAWTEXT(加码>0 ,L*0.99,'加码'),COLORYELLOW;
STICKLINE(加码>0,H,L,1,0),LINETHICK2,COLORYELLOW;
STICKLINE(加码>0,O,C,4,1),LINETHICK2,COLORYELLOW;