input:y(2011,1991,2099),m(6,1,12),d(30,1,31),y1(2011,1992,2099),m1(9,1,12),d1(31,1,31),y2(2011,1992,2099),m2(9,1,12),d2(31,1,31);
{成交额}
成交额:AMOUNT/10000000,COLORb400ff;
STICKLINE(成交额,成交额,0,6,0),COLORGRAY;
mm:=(y-1900)*10000+m*100+d;{最早日期}
mb:=(y1-1900)*10000+m1*100+d1;{中间日期}
mn:=(y2-1900)*10000+m2*100+d2;{最晚日期}
zz:=LAST(DATE>mm)+1;{DATE-1900年以来年月日}
zb:=LAST(DATE>mb)+1;{中间}
zc:=LAST(DATE>mn)+1;
VERTLINE(zz=2,1),COLORgreen;{绘起点垂直线}
VERTLINE(zb=2,1),COLORffffff;{绘中间垂直线}
VERTLINE(zc=2,1),COLORFFFF00;{绘终点垂直线}
个股季:=ref(sum(AMOUNT,zz-zb)/sum(VOL*100,zz-zb),zb);
个股今:=ref(sum(AMOUNT,zb-zc)/sum(VOL*100,zb-zc),zc);
指数季:=ref(ma(c,zz-zb),zb);
指数今:=ref(ma(c,zb-zc),zc);
if zb>1 then begin 季区间成本:if(CATEGORY=1,个股季,指数季),COLORFFFFFF,LINETHICK0;end;{季区间成本}
if zc>1 then begin 今区间成本:if(CATEGORY=1,个股今,指数今),COLORFFFFFF,LINETHICK0;end;{今区间成本}
季区间换手:=ref(SUM(VOL,zz-zb)/CAPITAL*100,zb);
今区间换手:=ref(SUM(VOL,zb-zc)/CAPITAL*100,zc);
if zb>1 then begin 季区间换手%:if(CATEGORY=1,季区间换手,指数季),COLORFFFF00,LINETHICK0;end;{季区间换手}
if zc>1 then begin 今区间换手%:if(CATEGORY=1,今区间换手,指数今),COLORFFFF00,LINETHICK0;end;{今区间换手}
DRAWTEXT(zz=2,(LLVALL(HIGH)+HHVALL(HIGH))/2,'起点'),LINETHICK3,ALIGN1,COLORgreen;
DRAWTEXT(zb=2,(LLVALL(HIGH)+HHVALL(HIGH))/2,'中点'),LINETHICK3,ALIGN1,COLORffffff;
DRAWTEXT(zc=2,(LLVALL(HIGH)+HHVALL(HIGH))/2,'终点'),LINETHICK3,ALIGN1,COLORFFFF00;
drawtextABS(700,10,'●季区间成本 '+NUMTOSTRN(季区间成本,2)+'元'),colorffFFff;
drawtextABS(960,10,'●今区间成本 '+NUMTOSTRN(今区间成本,2)+'元'),colorffFFff;
drawtextABS(700,25,'●季区间换手 '+NUMTOSTRN(季区间换手%,1)+'%'),colorffFF00;
drawtextABS(960,25,'●今区间换手 '+NUMTOSTRN(今区间换手%,1)+'%'),colorffFF00;
VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;
A:SMA(VAR1,7,1),LINETHICK1,COLOR00FFFF;
VAR2:=SMA(A,5,1);
B:IF(CROSS(A,VAR2) AND CROSS(MA(C,5),MA(C,13) AND A>50) ,VAR2*2,VAR2),COLORYELLOW;