CCI指标,是炒股基础指标之一,但由于过简洁,且从-100至100区域为盘整,从小于-100向-100上穿和从100向100外上穿为投机机会,反之而相反,相信很多股友常被这两句话绕晕了。今作一图,骨子里绝对是CCI,仅仅在画线上下了点功夫,使其一目了然,便于盘中使用,废话不多说了,直写源码(图中B字是延长画线法,相当于Z转向器,权当一笑玩玩而已)。选股器下载导入后就看到效果了。可向前选一时间段选股而验证,看看本人的写式功力如何,我是通达信源码写的,可直接导入
{影子CCI}
X:=CCI; A:=100;B:=-100;
DRAWBAND(X,RGB(150,0,0),100,RGB(0,100,50));
STICKLINE(X>=0,-100,100,100,0),COLORBLACK ;
STICKLINE(X<=0,-100,100,100,0),COLORBLACK ;
DRAWICON(CROSS(X,A),80,1);DRAWICON(CROSS(X,B),-120,1);
DRAWICON(CROSS(A,X),120,2);DRAWICON(CROSS(B,X),-80,2);
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),COLORYELLOW;
天线:100,COLORLIMAGENTA;
中:0,DOTLINE,COLORWHITE ;
地线:-100,COLORLIGREEN;
CA:=CROSS(EMA(C,7),EMA(C,19));
CB:=CROSS(EMA(C,19),EMA(C,7));
A1:=L=LLV(L,BARSLAST(CB)+1);
A2:=LLV(L,BARSLAST(CB)+1);
A3:=H=HHV(H,BARSLAST(CA)+1);
A4:=HHV(H,BARSLAST(CA)+1);
B1:=H=HHV(H,BARSLAST(CA)+1);
B2:=HHV(H,BARSLAST(CA)+1);
B3:=L=LLV(L,BARSLAST(CB)+1);
B4:=LLV(L,BARSLAST(CB)+1);
NA:=DRAWLINE(A1,A2,A3,A4,0);
NB:=DRAWLINE(B1,B2,B3,B4,0);
MD:=IF(NB<REF(NB,1) AND NB=NA,1,0);
买点:IF(REF(MD,1)=0 AND MD>=1,80,0),STICK,COLORRED;
DRAWICON(买点=80,-25,7);
DRAWTEXT(CURRBARSCOUNT=45,-400/1.5,'使用 :CCI>100 时,买进,CCI<100 时,卖出;
CCI<-100 时,放空,CCI>-100 时,回补。'),COLOR00FFFF;
1716111009.jpg
|