开心小猪 2007-12-6 12:02
请哪位老师看看指标这样编辑对不对?谢谢!
{分笔量}
卖价1:=askprice(1);
买价1:=bidprice(1);
委买1:=bidvol(1);
委卖1:=askvol(1);
买上:=if(c>ref(c,1),BUYVOL,0);
买0:=if(c=ref(c,1) and c=ref(买价1,1) and 买价1=ref(买价1,1) and ref(委买1,1)>委买1 and BUYVOL>ref(委买1,1)-委买1,ref(委买1,1)-委买1,
if(c=ref(c,1) and c=ref(买价1,1) and 买价1>ref(买价1,1) and BUYVOL>=ref(委买1,1),ref(委买1,1),0));
买1:=if(c=ref(c,1) and c=ref(卖价1,1) and 卖价1=ref(卖价1,1) and ref(委卖1,1)>委卖1 and BUYVOL>ref(委卖1,1)-委卖1 ,ref(委卖1,1)-委卖1,
if(c=ref(c,1) and c=ref(卖价1,1) and 卖价1>ref(卖价1,1) and BUYVOL>=ref(委卖1,1),ref(委卖1,1),0));
卖下:=if(c<ref(c,1),SELLVOl,0);
卖0:=if(c=ref(c,1) and c=ref(卖价1,1) and 卖价1=ref(卖价1,1) and ref(委卖1,1)>委卖1 and SELLVOL>ref(委卖1,1)-委卖1,ref(委卖1,1)-委卖1,
if(c=ref(c,1) and c=ref(卖价1,1) and 卖价1<ref(卖价1,1) and SELLVOl>=ref(委卖1,1),ref(委卖1,1),0));
卖1:=if(c=ref(c,1) and c=ref(买价1,1) and 买价1=ref(买价1,1) and ref(委买1,1)>委买1 and SELLVOl>ref(委买1,1)-委买1 ,ref(委买1,1)-委买1,
if(c=ref(c,1) and c=ref(买价1,1) and 买价1<ref(买价1,1) and SELLVOl>=ref(委买1,1),ref(委买1,1),0));
主买:=if(BUYVOL>买上+买0+买1,买上+买0+买1,BUYVOL),COLORRED;
主卖:=if(SELLVOl>卖下+卖0+卖1,卖下+卖0+卖1,SELLVOl)*-1,COLORFF6600;
隐买:=if(SELLVOl-主卖>0,SELLVOl-主卖,0),COLORFF00FF;
隐卖:=if(BUYVOL-主买>0,BUYVOL-主买,0)*-1,COLORGREEN;
买:=主买+隐买;
卖:=主卖+隐卖;
a:=买*c/100;
b:=卖*c/100;
机构买:=IF(a>=100,买,0);
机构买入:=SUM(机构买,0);
机构卖:=IF(b>=100,卖,0);
机构卖出:=SUM(机构卖,0);
机构增仓:机构买入-机构卖出;
大户买:=IF((a>20 and a<100),买,0);
大户买入:=SUM(大户买,0);
大户卖:=IF((b>20 and b<100),卖,0);
大户卖出:=SUM(大户卖,0);
大户增仓:大户买入-大户卖出;
散户买:=IF(a<=20,买,0);
散户买入:=SUM(散户买,0);
散户卖:=IF(b<=20,卖,0);
散户卖出:=SUM(散户卖,0);
散户增仓:散户买入-散户卖出;
{当天的分笔量按手数统计柱线表示}
机构d:=stkindi('','分笔量.机构增仓',0,0);
大户d:=stkindi('','分笔量.大户增仓',0,0);
散户d:=stkindi('','分笔量.散户增仓',0,0);
机构:=sum(机构d,0);
大户:=sum(大户d,0);
散户:=sum(散户d,0);
总:=机构+大户+散户;
机构比:=机构/总*100;
大户比:=大户/总*100;
散户比:=散户/总*100;
STICKLINE(BARSTATUS=2 and 机构比>0,0,机构比,8,0),shift5,COLOR0099FF;
STICKLINE(BARSTATUS=2 and 机构比<0,0,-机构比-0,8,0),shift5,COLORBLUE;
STICKLINE(BARSTATUS=2 and 大户比>0,0,大户比,8,0),shift6,COLORMAGENTA;
STICKLINE(BARSTATUS=2 and 大户比<0,0,-大户比-0,8,0),shift6,COLOR007300;
STICKLINE(BARSTATUS=2 and 散户比>0,0,散户比,8,0),shift7,COLOR5454ff;
STICKLINE(BARSTATUS=2 and 散户比<0,0,-散户比-0,8,0),shift7,COLORFFA500;
有不对的请老师批评并帮助修改!谢谢!