DRAWGBK(1, COLORRGB(100,100,100),COLORRGB(50,50,50),0);
svol:=INTPART(SUM(V,0)/CAPITAL);
tj0:=svol>REF(svol,1) or BARSSINCE(CLOSE)=0;
S1:=BARSLAST(tj0)+1,PRECISION,COLORWHITE;//时间1
tj2:=S1<ref(S1,1);//取点
S2:=if(tj2,ref(S1,1)+1,S1),PRECISION,COLORMAGENTA;//时间2
S3:=sum(tj2,0),COLORMAGENTA;
阶段总额(万元):=SUM(AMOUNT/10000,S2)*100,PRECISION,LINETHICK,Color008BFA;//换手100%成交额
阶段总量(手):=SUM(V,S2)*100,PRECISION,LINETHICK,COLORCYAN;//换手100%成交量
阶段成本(元):=(阶段总额(万元)/(阶段总量(手)/100)),LINETHICK,PRECISION2,COLORRED;
DRAWTEXT(BARPOS=SYSPARAM(2),h,'■阶段平均成本:'+NUMTOSTR(阶段成本(元)[SYSPARAM(1)],2)+'(元)'),align4,COLORCYAN;
Zk1:=STKINDI('' ,'kdj.k',0,7);
Zd2:=STKINDI('' ,'kdj.d',0,7);
ZF1:=STKINDI('' ,'MACD.diff',0,7);
ZA2:=STKINDI('' ,'macd.dea',0,7);
换手率:v/FINANCE(7),LINETHICK,PRECISION2,COLORCYAN;{换手率}
JCD:=FILTER(CROSS(Zk1,Zd2)&&Zd2<30,13);{周KD金叉位置}
取点:=barslast(JCD);
吸筹区:=if(取点>0 and 取点<61,取点,0);
ZS1:=吸筹区;
ZS2:=吸筹区+1;
ZS3:=换手率/5;{庄家筹码估算}
ZSA:=IF(ZS1>0,sum((ZS3),吸筹区+1),0);{统计庄家筹码}
{控制画线高度}
n1:=sysparam(3);
nn:=n1-sysparam(2)+1;
hh:=hhv(换手率,nn);
ll:=llv(换手率,nn);
最高:=hh[n1];
最低:=ll[n1];
中:=最低+(最高-最低)*0.5;
换手冷清:STICKLINE(换手率<3,0,换手率,4,1),COLORWHITE;//冷清
换手活跃:STICKLINE(换手率>=3 and 换手率<7,0,换手率,4,1),COLORYELLOW;//活跃
换手热烈:STICKLINE(换手率>=7,0,换手率,4,1),COLORRED;//热烈
PARTLINE(C,MA(换手率,13)),Color0089FF;
PARTLINE(C,MA(换手率,55)),COLOR009900;
PARTLINE(RANGE(BARPOS,SYSPARAM(2),SYSPARAM(1)+1)&&ZS1>0,中),COLORCYAN;//建仓横线 copyright dedecms
VERTLINE(JCD),LINEDOT,COLORGREEN;//建仓点竖线
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(1)&&SYSPARAM(1)>ZS1,中*2,' 主力建仓天数:'+NUMTOSTR(ZS1[SYSPARAM(1)],0)+'(天) '),PXDN30,align2,COLORGREEN;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(1)&&SYSPARAM(1)>ZS1,中*2,' \n 估算主力筹码:'+NUMTOSTR(ZSA[SYSPARAM(1)],2)+'% '),PXDN30,align2,COLORMAGENTA;
DRAWICON(FILTER(CROSS(ZF1,ZA2),5),0,4),align5;
DRAWICON(FILTER(CROSS(Zk1,Zd2),5),0,8),align5;
DRAWICON(FILTER(CROSS(Zd2,Zk1),5),0,9),align5;