TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
XD:=CROSS(CCI,3);
XG:=((HIGH+LOW+CLOSE)/3-MA((HIGH+LOW+CLOSE)/3,14))/(0.015*AVEDEV((HIGH+LOW+CLOSE)/3,14));
CD1:=IF(REF(XG,1)<-99 AND XG>-98,1,0);
CD2:=IF(REF(CD1,1)=1 AND XG>-50,1,0);
CD3:=IF(REF(CD1,2)=1 AND XG>-50 AND REF(XG,1)>-50,1,0);
CD4:=IF(REF(CD1,3)=1 AND XG>-50 AND REF(XG,1)>-50,1,0);
CD5:=IF(REF(CD1,4)=1 AND XG>-50 AND REF(XG,1)>-50 AND REF(XG,2)>-50,1,0);
STICKLINE(XD,L*0.99,L*0.98,6,0),LINETHICK1,COLOR00ff00;
STICKLINE(XD,L*0.99,L*0.98,4,0),LINETHICK1,COLOR0055ff;
STICKLINE(XD,L*0.99,L*0.98,2,0),LINETHICK1,COLOR00ffff;
STICKLINE(CD1,L*0.99,L*0.98,6,0),LINETHICK1,COLOR99ff00;
STICKLINE(CD1,L*0.99,L*0.98,4,0),LINETHICK1,COLOR55ff00;
STICKLINE(CD1,L*0.99,L*0.98,2,0),LINETHICK1,COLOR00ffff;
STICKLINE(CD2,L*0.99,L*0.98,6,0),LINETHICK1,COLOR0044ff;
STICKLINE(CD2,L*0.99,L*0.98,4,0),LINETHICK1,COLOR0055ff;
STICKLINE(CD2,L*0.99,L*0.98,2,0),LINETHICK1,COLOR00ffff;
STICKLINE(CD3,L*0.99,L*0.98,6,0),LINETHICK1,COLOR0000ff;
STICKLINE(CD3,L*0.99,L*0.98,4,0),LINETHICK1,COLOR5555ff;
STICKLINE(CD3,L*0.99,L*0.98,2,0),LINETHICK1,COLOR00ffff;
STICKLINE(CD4,L*0.99,L*0.98,6,0),LINETHICK1,COLOR55ff00;
STICKLINE(CD4,L*0.99,L*0.98,4,0),LINETHICK1,COLOR22ff00;
STICKLINE(CD4,L*0.99,L*0.98,2,0),LINETHICK1,COLOR00ffff;
STICKLINE(CD3,L*0.99,L*0.98,6,0),LINETHICK1,COLOR0000ff;
STICKLINE(CD3,L*0.99,L*0.98,4,0),LINETHICK1,COLOR00ff00;
STICKLINE(CD5,L*0.99,L*0.98,2,0),LINETHICK1,COLOR00ffff;
DRAWTEXT(CROSS(-100,CCI) AND CCI
DRAWTEXT(CROSS(200,CCI) AND CCI
DRAWTEXT(CROSS(100,CCI) AND CCI
重心:(2*C+H+L+O/2)/4.5,COLOR00FFFF,LINETHICK0;
M心5:=WMA(重心,5);
PARTLINE(M心5,M心5>REF(M心5,1),rgb(255,0,0),M心5<=REF(M心5,1),rgb(0,255,0) ),LINETHICK2,LAYER3;
XL:=BARSLAST(DISPSTATUS=1)+1;
E:=llvall(llv(L,XL))*0.95;
DRAWTEXTABS(350,5,'指标:CCI'),Color00ffff,LINETHICK4;
TYP := (HIGH + LOW + CLOSE)/3;
CCI:(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),Color05FF00,LINETHICK0;;
STICKLINE(CCI>0,E+CCI/500,E,4,0),Color0077FF;
STICKLINE(CCI<0,E+CCI/500,E,4,0),ColorFF9900;