INPUT:时段起点(1,1,9999),时段终点(0,0,9999); AA:=时段起点+1; BB:=时段终点+1; CYC:=IF(CAPITAL=0,(SUM(C,AA)-SUM(C,BB))/(AA-BB),(SUM(AMOUNT,AA)-SUM(AMOUNT,BB))/(SUM(VOL,AA)-SUM(VOL,BB))/100); 成本:=CYC[DATACOUNT],COLORWHITE,LINETHICK0; 换手:=(SUM(VOL,AA)-SUM(VOL,BB))/CAPITAL*100; 计算周期:=AA-BB; N1:=IF(DATATYPE=8,1.05,IF(DATATYPE=7,1.02,1.01)); N2:=IF(DATATYPE=8,0.95,IF(DATATYPE=7,0.98,0.99)); VERTLINE(IF(BARPOS=0 ,ISLASTBAR,BARPOS=DATACOUNT-时段起点)),LINEDOT,COLORYELLOW; DRAWTEXT(ISLASTBAR=0 AND BARPOS=DATACOUNT-时段起点,SYSPARAM(5),'起点'),COLORYELLOW; VERTLINE(IF(BARPOS=0,ISLASTBAR,BARPOS=DATACOUNT-时段终点)),LINEDOT,COLORYELLOW; DRAWTEXT(ISLASTBAR=0 AND BARPOS=DATACOUNT-时段终点,SYSPARAM(5),'终点'),COLORYELLOW; {www.gpxiazai.com 股票软件下载网_最新股票指标公式} FILLRGN(BARPOS>DATACOUNT-时段终点,成本*N1,成本*N2),Color808080; DRAWLINE(IF(BARPOS=0,ISLASTBAR,BARPOS=DATACOUNT-时段终点),成本, ISLASTBAR,REF(成本,1),0),ColorFFFFFF; KLINE(O,H,L,C,0); DRAWTEXT(IF(BARPOS=0 ,ISLASTBAR,BARPOS=DATACOUNT-时段终点),REF(成本,BARSLAST(BARSCOUNT(C)=DATACOUNT-时段终点)), '区间计算周期='+NUMTOSTR(计算周期,0)+' '),ALIGN2,PXUP30,ColorFFFFFF; DRAWTEXT(IF(BARPOS=0 ,ISLASTBAR,BARPOS=DATACOUNT-时段终点),REF(成本,BARSLAST(BARSCOUNT(C)=DATACOUNT-时段终点)), '区间成本='+NUMTOSTR(成本,2)+'元'+' '),ALIGN2,PXDN20,ColorFFFFFF; DRAWTEXT(IF(BARPOS=0 ,ISLASTBAR,BARPOS=DATACOUNT-时段终点) AND CAPITAL>0,REF(成本,BARSLAST(BARSCOUNT(C)=DATACOUNT-时段终点)), '区间换手='+NUMTOSTR(换手,2)+'%'+' '),ALIGN2,PXDN65,ColorFFFFFF; |