要想预知股价的将要涨还是将要跌,必看主动率,真假主动率我是转帖,加上我编的你会更清楚主动率的重要性,两个公式后边的用大括号括上的分笔公式的源码。【用于分笔时把大括号拿掉】
【1】
{主动买卖B------用于分时}
DRAWRECTREL(-1,0,1000,1000,RGB(0,0,10)),color0077FF,LINETHICK2,LAYER7;0,DOTLINE,LAYER0;
主动买:"分笔买卖.主动买#tick",colorred,linethick0,PRECIS0;
主动卖:"分笔买卖.主动卖#tick",coloryellow,linethick0,PRECIS0;
主动净量:-主动卖,colorstick,linethick0,PRECIS0;
主动率:主动买/(主动卖+主动买)*100,colorwhite,PRECIS2,linethick0;
DRAWTEXTABS(0,5,IFS((主动率 >= 50),'【FB主动率】▄ '+NUMTOSTRN(主动率,1)+'%,','')),linethick4,color00FFFF;
DRAWTEXTABS(0,5,IFS((主动率< 50),'【FB主动率】▄ '+NUMTOSTRN(主动率,1)+'%,','')),linethick4,color00FF00;
RSV:EMA(主动净量,3),LINETHICK0;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
Var1:3*K-2*D,LINETHICK1;
FILLRGN(Var1,Var1*0.95,Var1>REF(Var1,1),RGB(255,0,0),Var1<REF(Var1,1),RGB(0,255,0)),LINETHICK2,LAYER0;
if(Var1>=0,Var1*0.1,0),COLORCCCCFF,LAYER2;
if(Var1>=0,Var1*0.2,0),COLORBBBBFF,LAYER2;
if(Var1>=0,Var1*0.3,0),COLORAAAAFF,LAYER2;
if(Var1>=0,Var1*0.4,0),COLOR9999FF,LAYER2;
if(Var1>=0,Var1*0.5,0),COLOR8888FF,LAYER2;
if(Var1>=0,Var1*0.6,0),COLOR7777FF,LAYER2;
if(Var1>=0,Var1*0.7,0),COLOR6666FF,LAYER2;
if(Var1>=0,Var1*0.8,0),COLOR4444FF,LAYER2;
if(Var1>=0,Var1*0.9,0),COLOR2222FF,LAYER2;
if(Var1<0,Var1*0.1,0),COLORFFAAAA,LAYER2;
if(Var1<0,Var1*0.2,0),COLORFF9999,LAYER2;
if(Var1<0,Var1*0.3,0),COLORFF8888,LAYER2;
if(Var1<0,Var1*0.4,0),COLORFF7777,LAYER2;
if(Var1<0,Var1*0.5,0),COLORFF6666,LAYER2;
if(Var1<0,Var1*0.6,0),COLORFF5555,LAYER2;
if(Var1<0,Var1*0.7,0),COLORFF4444,LAYER2;
if(Var1<0,Var1*0.8,0),COLORFF2222,LAYER2;
if(Var1<0,Var1*0.9,0),COLORFF0000,LAYER2;
FILLRGN(Var1,0,Var1<0,RGB(80,0,60)),COLORFF9900,LINETHICK2,LAYER7;
FILLRGN(Var1,0,Var1>0,RGB(0,0,255)),COLOR00FF00,LINETHICK2,LAYER7;
A1:=DYNAINFO(23) /(DYNAINFO(23)+ DYNAINFO(22))*100;
A2:=DYNAINFO(17);
DRAWTEXTABS(0,30,IFS((A1 >= 50),'【FS主动率】▄ '+NUMTOSTRN(A1,1)+'%,','')),linethick4,color0000FF;
DRAWTEXTABS(0,30,IFS((A1 < 50),'【FS主动率】▄ '+NUMTOSTRN(A1,1)+'%,','')),linethick4,color00FF00;
{分笔买卖---用于-分笔}
{主动买:SUM(BUYVOL,0),Color0000ff,linethick2;
主动卖:SUM(SELLVOL,0),Color00ff00,linethick2;
主动净量:主动买-主动卖,colorstick,linethick0,PRECIS0;
主动率:主动买/(主动卖+主动买)*100,colorwhite,PRECIS2,linethick0;
DRAWTEXTABS(0,5,IFS((主动率 >= 50),'【主动买/(主买+主卖)*100】▄ '+NUMTOSTRN(主动率,1)+'%,','')),linethick4,color00FFFF;
DRAWTEXTABS(0,5,IFS((主动率< 50),'【主动买/(主买+主卖)*100】▄ '+NUMTOSTRN(主动率,1)+'%,','')),linethick4,color00FF00;
买卖次:BARSSINCE(v)+1,PRECIS0;
主买:SUM(BUYVOL,买卖次),PRECIS0;
主卖:SUM(SELLVOL,买卖次),PRECIS0;
成交笔数:SUM(TICKCOUNT,0),PRECIS0;
主买次:SUM(ISBUYORDER,0),PRECIS0;};
【2】
{真假主差----用于分时}
DRAWRECTREL(-1,0,1000,1000,RGB(0,0,10)),color00FF00,LINETHICK2,LAYER7;0,DOTLINE,LAYER0;
真主动:"BSVOL.true#tick",color0000FF,linethick2,LAYER0;
假主动:"BSVOL.false#tick",color00FFFF,linethick2,LAYER0;
真假主差:"BSVOL.true#tick"-"BSVOL.false#tick",linethick0;
fillrgn(真主动,假主动,真假主差>0,RGB(200,0,100),真假主差<0,RGB(0,80,80));
真主动率:"BSVOL.真主动率#tick",color0000FF,linethick0,LAYER0;
假主动率:"BSVOL.假主动率#tick",color00FFFF,linethick0,LAYER0;
真主动净量:"BSVOL.真主动净量#tick",color00FF00,linethick0,LAYER0;
DRAWTEXTABS(0,5,'【真主动率】▄ '+NUMTOSTRN(真主动率,1)+'%,'),linethick4,color0000FF;
DRAWTEXTABS(0,25,'【假主动率】▄ '+NUMTOSTRN(假主动率,1)+'%,'),linethick4,color00ffFF;
【原编者原话---我是转帖】
{说“假主动率”确实有些用词不当,其实BUYVOL就是真的主动买量。我的思路是,
当一笔BUYVOL进行时会产生3个实体量,其一就是BUYVOL本身,其二是委托卖单量,
其三是同一时间的SELLVOL量,我将这3种量进行区分获取真正使股价上升或者下降的部分成交量,
并称之为真主动。通过判断到底买卖量是用在了原地上,还是拉升上,还是大多被对敲掉了,
来看出买卖方向的意愿。};
{BSVOL-----用于分笔}{n(0,0,270,30)}
{var1:=sum(if(bidprice(1)>ref(bidprice(1),1),(buyvol-sellvol),N),0);
var2:=sum(if(bidprice(1)=ref(bidprice(1),1),(buyvol-sellvol),N),0);
var3:=sum(if(bidprice(1)<ref(bidprice(1),1),(sellvol-buyvol),N),0);
True:(var1+var2-var3)/(var1+abs(var2)+var3)*sum(v,N)/capital*100,Color0000ff;
false:(sum(buyvol,N)-sum(sellvol,N))/(sum(buyvol,N)+sum(sellvol,N))*sum(v,N)/capital*100,Color00ff00;
var1a:=sum(if(bidprice(1)>ref(bidprice(1),1),(buyvol),N),0);
var2a:=sum(if(bidprice(1)=ref(bidprice(1),1),(buyvol),N),0);
var3a:=sum(if(bidprice(1)<ref(bidprice(1),1),(sellvol),N),0);
真主动率:(var1+var2)/(abs(var1)+abs(var2)+abs(var3))*100,Color0000ff,linethick0;
假主动率:(sum(buyvol,N))/(sum(buyvol,N)+sum(sellvol,N))*100,Color00ff00,linethick0;
真主动净量:(var1+var2-var3)*sum(v,N)/capital*100,linethick0;
主动买:SUM(BUYVOL,0),Color0000ff,linethick0;
主动卖:SUM(SELLVOL,0),Color00ff00,linethick0;
主动净量:主动买-主动卖,colorstick,linethick0,PRECIS0;};
|