input:y(2010,1991,2099),m(7,1,12),d(1,1,31),y1(2011,1992,2099),m1(7,1,12),d1(31,1,31);
mm:=(y-1900)*10000+m*100+d;{最早日期}
mn:=(y1-1900)*10000+m1*100+d1;{最晚日期}
zz:=LAST(DATE>mm)+1;
zc:=LAST(DATE>mn)+1;
VERTLINE(zz=2,1),coloryellow;
VERTLINE(zc=2,2),coloryellow;
DRAWTEXT(zz=2,(LLVALL(HIGH)+HHVALL(HIGH))/2,'起点'),LINETHICK3,ALIGN1,COLORgreen;
DRAWTEXT(zc=2,(LLVALL(HIGH)+HHVALL(HIGH))/2,'终点'),LINETHICK3,ALIGN1,COLORred;
个股:=ref(sum(AMOUNT,zz-zc)/sum(VOL*100,zz-zc),zc);
指数:=ref(ma(c,zz-zc),zc);
区间换手:ref(SUM(VOL,zz-zc)/CAPITAL*100,zc),linethick0 ;
if zc>1 then begin 区间成本:if(CATEGORY=1,个股,指数),COLORFFFFFF,LAYER2;end;
N1:=IF(DATATYPE=10,1.05,IF(DATATYPE=9,1.02,1.01));
N2:=IF(DATATYPE=10,0.95,IF(DATATYPE=9,0.98,0.99));
FILLRGN(区间成本*N1,区间成本*N2,zc>1,rgb(128,128,128)),LAYER3;
区间计算周期:zz-zc,PRECIS0,linethick0 ;
DRAWTEXTABS(588,20,'区间成本 = '+NUMTOSTRN(区间成本 ,2)+' 元'),LAYER0,ColorFFC000,linethick3;
{以下设置五彩立体K线}
STICKLINE(CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1),LOW,HIGH,0.1,0),LAYER1,colorred;
STICKLINE(CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1),OPEN,CLOSE,7,0),LAYER1,colorred;
STICKLINE(CLOSE<OPEN or CLOSE=OPEN and CLOSE<=REF(CLOSE,1),LOW,HIGH,0.1,0),LAYER1,colorcyan;
STICKLINE(CLOSE<OPEN or CLOSE=OPEN and CLOSE<=REF(CLOSE,1),OPEN,CLOSE,7,0),LAYER1,colorcyan;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),LAYER1,COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,8,0 ),LAYER1,COLOR008800;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),LAYER1,COLOR009900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),LAYER1,COLOR00AA00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),LAYER1,COLOR00BB00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),LAYER1,COLOR00CC00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),LAYER1,COLOR00DD00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),LAYER1,COLOR00EE00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),LAYER1,COLOR00FF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0),LAYER1 ,COLORFFBBFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8,0),LAYER1 ,COLORFF00FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0),LAYER1 ,COLORFF22FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,LAYER1,COLORFF44FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0),LAYER1 ,COLORFF66FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0),LAYER1 ,COLORFF88FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0),LAYER1 ,COLORFF99FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0),LAYER1 ,COLORFFAAFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0),LAYER1 ,COLORFFBBFF;