N:=3;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N)),COLORYELLOW,LINETHICK2;
A:100,COLORGREEN,LINETHICK2;
B:-100,COLORRED,LINETHICK2;
K1:=CROSS(CCI,B);
K2:=CROSS(CCI,A);
K3:=CROSS(A,CCI);
K4:=CROSS(B,CCI);
DRAWTEXT(K1,K1*-120,'入场'),COLORYELLOW;
DRAWTEXT(K4,K4*-120,'等待'),COLORBLUE;
DRAWTEXT(K2,K2*120,'加仓'),COLORYELLOW;
DRAWTEXT(K3,K3*120,'离场'),COLORMAGENTA;