DRAWTEXT_FIX(1,0.01,0.01,0,'【★★仓位控制的量化标准★★】'),COLORMAGENTA;
E1:=EXPMA(C,5);
E3:=EXPMA(C,20);
E5:=EXPMA(C,60);
VARE2:=(E1+E2+E3+E5)/4;
D1:=IF(N=1,0.013,0.03);
C1:=IF(N=1,0.015,0.03);
短线多:EXPMA(VARE1,5)+EXPMA(VARE1,5)*D1,COLORRED;
长线多:EXPMA(VARE2,70)+EXPMA(VARE2,70)*C1,COLORMAGENTA;
{DRAWKLINE(H,O,L,C);}
TJ2:=RANGE(C,长线空,长线多);
STICKLINE(短线多<REF(短线多,1) AND TJ1=0,短线多,短线空,0.1,1),COLORGREEN;
STICKLINE(长线多<REF(长线多,1) AND TJ2=0,长线多,长线空,0.1,1),COLORBLUE;
NOTEXT短线空:IF(短线空<REF(短线空,1),短线空,DRAWNULL),COLORGREEN;
NOTEXT长线空:IF(长线空<REF(长线空,1),长线空,DRAWNULL),COLORBLUE;
多:=REF(C,1)<REF(短线多,1) AND C>短线多 AND C>REF(C,1){ AND COUNT(C<长线多,5)>0};
多1:=TFILTER(多,空,1);
DRAWTEXT(多1,短线空*0.96,'多'),COLORRED;
DRAWICON(多1,短线空*0.98,1);
A2:=BARSLASTCOUNT(A1);
A4:=REF(BETWEEN(A2,5,8),1) AND A2<REF(A2,1);
A6:=(BACKSET(A3>0,9) OR BACKSET(A4>0,A2+1)*0 OR BACKSET(A5>0,A2))*A2;
DRAWTEXT(A2=9,H+H*0.02,'9'),COLOR00FF00;
B2:=BARSLASTCOUNT(B1);
B4:=REF(BETWEEN(B2,5,8),1) AND B2<REF(B2,1);
B6:=(BACKSET(B3>0,9) OR BACKSET(B4>0,B2+1)*0 OR BACKSET(B5>0,B2))*B2;
DRAWTEXT(B2=9,L-L*0.02,'9'),COLORFF00FF;
卖线:=EMA(SLOPE(C,21)*20+C,42);
SEL:=CROSS(卖线,买线);
DRAWICON(SEL,H+0.1,2);
STICKLINE(买线>=卖线,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(买线<卖线,CLOSE,OPEN,2,1),COLORGREEN;
操盘:=MA(CLOSE,9),COLORCYAN,LINETHICK2;
LC:=REF(CLOSE,1);
MA15:=EMA(CLOSE,21);
高1:=REF(HHV(H,日),昨前);
H1:=高1-(高1-低1)*0.191;
H3:=高1-(高1-低1)*0.5;
H5:=高1-(高1-低1)*0.809;