收集:中国股票市场经济分析网

二版更新至下方
网上分笔公式满天飞,还老喜欢加密,其实都是很简单的玩意。
说白了都是 buyvol 和 sellvol

功能:
1. 图形查看成交量堆积在当日股价的分布
2. 图形查看大小单占总成交量的比值
3. 小差 大差 特大差 走势
4. 大单 特大单门限自定义


{a1: 10 , 1 , 1000 a2:100,1,1000}

现价:=c;
Var2:=REF(ASKPRICE(1),1);
Var3:=REF(BIDPRICE(1),1);
Var4:=(Var2-Var3)*0.35;
{
Var5:=IF(现价>=Var2-Var4,VOL,IF(现价<Var2-Var4 AND 现价>Var3+Var4,BUYVOL,0));
Var6:=IF(现价<=Var3+Var4,VOL,IF(现价<Var2-Var4 AND 现价>Var3+Var4,SELLVOL,0));
}

var5:=buyvol;
var6:=sellvol;


x1:=a1*10000;
x2:=a2*10000;

tdb:=IF(AMOUNT>=x2,Var5,0);
特大买量:=sum(tdb,0);
tds:=IF(AMOUNT>=x2,Var6,0);
特大卖量:=sum(tds,0);

db:=IF(AMOUNT>=x1 and amount<x2,Var5,0);
ds:=IF(AMOUNT>=x1 and amount<x2,Var6,0);
大买量:=SUM(db,0);
大卖量:=SUM(ds,0);



小买量:=SUM(IF(AMOUNT<x1,Var5,0),0);
小卖量:=SUM(IF(AMOUNT<x1,Var6,0),0);


小量差:=小买量-小卖量;
大量差:=大买量-大卖量;
特大量差:=特大买量-特大卖量;
大上差:大量差+特大量差,COLORMAGENTA,linethick4,colorstick;
小量差,linethick1,colorgreen;
大量差,linethick2,colorwhite;
特大量差,linethick3,coloryellow;
大上差额:大上差*c/100,PRECIS0,linethick0;
大上比:大上差/capital*100,linethick0;

总量:=sum(vol,0);
强度:大上差/总量*40,linethick0;
0,colorblue,dotline;

sb:=小买量/总量*100;
ss:=小卖量/总量*100;

bb:=大买量/总量*100;
bs:=大卖量/总量*100;

lb:=特大买量/总量*100;
ls:=特大卖量/总量*100;

DRAWTEXTABS(10 ,10 ,'大上比%   '+大上比),colorwhite;

DRAWTEXTABS(10 ,80 ,'小买%'+sb),colorblue;
DRAWTEXTABS(10 ,95 ,'小卖%'+ss),colorblue;

DRAWTEXTABS(90 ,80 ,'大买%'+bb),colorblue;
DRAWTEXTABS(90 ,95 ,'大卖%'+bs),colorblue;

DRAWTEXTABS(170 ,80 ,'特买%'+lb),colorblue;
DRAWTEXTABS(170 ,95 ,'特卖%'+ls),colorblue;

DRAWRECTABS(40 ,78-sb , 50 ,78 ,RGB(255,0,0));
DRAWRECTABS(60 ,78-ss, 70 ,78 ,RGB(0,255,0));

DRAWRECTABS(110 ,78-bb , 120 ,78 ,RGB(255,0,0));
DRAWRECTABS(130 ,78-bs , 140 ,78 ,RGB(0,255,0));

DRAWRECTABS(190 ,78-lb , 200 ,78 ,RGB(255,0,0));
DRAWRECTABS(210 ,78-ls , 220 ,78 ,RGB(0,255,0));

{-------------看各价位上的成交累计------------}
DRAWTEXTABS(250 ,130 ,'-10-9-8-7-6-5-4-3-2-1   0+1+2+3+4+5+6+7+8+9+10'),COLORblue;


昨收:=DYNAINFO(3);
涨幅:=(c/昨收-1)*100;
n9:sum(if(涨幅<=-9,vol,0),0)/总量;
n8:sum(if(涨幅<=-8 and 涨幅>-9,vol,0),0)/总量;
n7:sum(if(涨幅<=-7 and 涨幅>-8,vol,0),0)/总量;
n6:sum(if(涨幅<=-6 and 涨幅>-7,vol,0),0)/总量;
n5:sum(if(涨幅<=-5 and 涨幅>-6,vol,0),0)/总量;
n4:sum(if(涨幅<=-4 and 涨幅>-5,vol,0),0)/总量;
n3:sum(if(涨幅<=-3 and 涨幅>-4,vol,0),0)/总量;
n2:sum(if(涨幅<=-2 and 涨幅>-3,vol,0),0)/总量;
n1:sum(if(涨幅<=-1 and 涨幅>-2,vol,0),0)/总量;
b0:sum(if(涨幅<=0 and 涨幅>-1,vol,0),0)/总量;
p1:sum(if(涨幅<=1 and 涨幅>0,vol,0),0)/总量;
p2:sum(if(涨幅<=2 and 涨幅>1,vol,0),0)/总量;
p3:sum(if(涨幅<=3 and 涨幅>2,vol,0),0)/总量;
p4:sum(if(涨幅<=4 and 涨幅>3,vol,0),0)/总量;
p5:sum(if(涨幅<=5 and 涨幅>4,vol,0),0)/总量;
p6:sum(if(涨幅<=6 and 涨幅>5,vol,0),0)/总量;
p7:sum(if(涨幅<=7 and 涨幅>6,vol,0),0)/总量;
p8:sum(if(涨幅<=8 and 涨幅>7,vol,0),0)/总量;
p9:sum(if(涨幅<=9 and 涨幅>8,vol,0),0)/总量;
p10:sum(if(涨幅<=10 and 涨幅>9,vol,0),0)/总量;

DRAWRECTABS(265 ,125-n9*200, 275 ,125 ,RGB(0,0,255));
DRAWRECTABS(277 ,125-n8*200, 287 ,125 ,RGB(0,0,255));
DRAWRECTABS(290 ,125-n7*200, 300 ,125 ,RGB(0,0,255));
DRAWRECTABS(302 ,125-n6*200, 312 ,125 ,RGB(0,0,255));
DRAWRECTABS(315 ,125-n5*200, 325 ,125 ,RGB(0,0,255));
DRAWRECTABS(327 ,125-n4*200, 337 ,125 ,RGB(0,0,255));
DRAWRECTABS(340 ,125-n3*200, 350 ,125 ,RGB(0,0,255));
DRAWRECTABS(352 ,125-n2*200, 362 ,125 ,RGB(0,0,255));
DRAWRECTABS(365 ,125-n1*200, 375 ,125 ,RGB(0,0,255));
DRAWRECTABS(377 ,125-b0*200, 387 ,125 ,RGB(0,0,255));

DRAWRECTABS(390 ,125-p1*200, 400 ,125 ,RGB(255,0,0));
DRAWRECTABS(402 ,125-p2*200, 412 ,125 ,RGB(255,0,0));
DRAWRECTABS(415 ,125-p3*200, 425 ,125 ,RGB(255,0,0));
DRAWRECTABS(427 ,125-p4*200, 437 ,125 ,RGB(255,0,0));
DRAWRECTABS(440 ,125-p5*200, 450 ,125 ,RGB(255,0,0));
DRAWRECTABS(452 ,125-p6*200, 462 ,125 ,RGB(255,0,0));
DRAWRECTABS(465 ,125-p7*200, 475 ,125 ,RGB(255,0,0));
DRAWRECTABS(477 ,125-p8*200, 487 ,125 ,RGB(255,0,0));
DRAWRECTABS(490 ,125-p9*200, 500 ,125 ,RGB(255,0,0));
DRAWRECTABS(502 ,125-p10*200, 512 ,125 ,RGB(255,0,0));
--
2版 ,4档分单 , 无单差走势线, 只显示统计图形:
--

---
源码:


分时看盘4档无走势线版

{a1:10 a2:20 a3:50}

现价:=c;
Var2:=REF(ASKPRICE(1),1);
Var3:=REF(BIDPRICE(1),1);
Var4:=(Var2-Var3)*0.35;
{
Var5:=IF(现价>=Var2-Var4,VOL,IF(现价<Var2-Var4 AND 现价>Var3+Var4,BUYVOL,0));
Var6:=IF(现价<=Var3+Var4,VOL,IF(现价<Var2-Var4 AND 现价>Var3+Var4,SELLVOL,0));
}
var5:=buyvol;
var6:=sellvol;
x1:=a1*10000;
x2:=a2*10000;
x3:=a3*10000;
tdb:=IF(AMOUNT>=x3,Var5,0);
特大买量:=sum(tdb,0);
tds:=IF(AMOUNT>=x3,Var6,0);
特大卖量:=sum(tds,0);
db:=IF(AMOUNT>=x1 and amount<x2,Var5,0);
ds:=IF(AMOUNT>=x1 and amount<x2,Var6,0);
中买量:=SUM(db,0);
中卖量:=SUM(ds,0);
db1:=IF(AMOUNT>=x2 and amount<x3,Var5,0);
ds1:=IF(AMOUNT>=x2 and amount<x3,Var6,0);
大买量:=SUM(db1,0);
大卖量:=SUM(ds1,0);

小买量:=SUM(IF(AMOUNT<x1,Var5,0),0);
小卖量:=SUM(IF(AMOUNT<x1,Var6,0),0);

小量差:小买量-小卖量,linethick0;
中量差:中买量-中卖量,linethick0;
大量差:大买量-大卖量,linethick0;
特大量差:特大买量-特大卖量,linethick0;
主力量差:大量差+特大量差,COLORred,linethick0,colorstick;
小量差,linethick0,colorgreen;
大量差,linethick0,colorwhite;
特大量差,linethick0,coloryellow;
主力差额:主力量差*c/100,PRECIS0,linethick0;
主力增仓:主力量差/capital*100,linethick0;
总量:=sum(vol,0);
强度:主力量差/总量*40,linethick0;
0,colorwhite,dotline;
sb1:=小买量/总量*100;
ss1:=小卖量/总量*100;

sb:=中买量/总量*100;
ss:=中卖量/总量*100;
bb:=大买量/总量*100;
bs:=大卖量/总量*100;
lb:=特大买量/总量*100;
ls:=特大卖量/总量*100;
DRAWTEXTABS(10 ,10 ,'主力量差 :   '+主力量差),COLORMAGENTA,linethick3;
DRAWTEXTABS(10 ,30 ,'主力增仓 :   '+主力增仓+'%'),COLORMAGENTA,linethick3;

DRAWTEXTABS(10 ,120 ,'小买% '+sb1),colorred;
DRAWTEXTABS(10 ,135 ,'小卖% '+ss1),colorgreen;
DRAWTEXTABS(90 ,120 ,'中买% '+sb),colorred;
DRAWTEXTABS(90 ,135 ,'中卖% '+ss),colorgreen;
DRAWTEXTABS(170 ,120 ,'大买% '+bb),colorred;
DRAWTEXTABS(170 ,135 ,'大卖% '+bs),colorgreen;
DRAWTEXTABS(250 ,120 ,'特买% '+lb),colorred;
DRAWTEXTABS(250 ,135 ,'特卖% '+ls),colorgreen;

DRAWRECTABS(40 ,118-sb1 , 50 ,118 ,RGB(255,0,0));
DRAWRECTABS(60 ,118-ss1, 70 ,118 ,RGB(0,255,0));

DRAWRECTABS(120 ,118-sb , 130 ,118 ,RGB(255,0,0));
DRAWRECTABS(140 ,118-ss, 150 ,118 ,RGB(0,255,0));

DRAWRECTABS(190 ,118-bb , 200 ,118 ,RGB(255,0,0));
DRAWRECTABS(210 ,118-bs , 220 ,118 ,RGB(0,255,0));

DRAWRECTABS(270 ,118-lb , 280 ,118 ,RGB(255,0,0));
DRAWRECTABS(290 ,118-ls , 300 ,118 ,RGB(0,255,0));

{-------------看各价位上的成交累计------------}
DRAWTEXTABS(250+200 ,130 ,'-10-9-8-7-6-5-4-3-2-1   0+1+2+3+4+5+6+7+8+9+10'),COLORwhite,linethick1;

昨收:=DYNAINFO(3);
涨幅:=(c/昨收-1)*100;
n9:sum(if(涨幅<=-9,vol,0),0)/总量,linethick0;
n8:sum(if(涨幅<=-8 and 涨幅>-9,vol,0),0)/总量,linethick0;
n7:sum(if(涨幅<=-7 and 涨幅>-8,vol,0),0)/总量,linethick0;
n6:sum(if(涨幅<=-6 and 涨幅>-7,vol,0),0)/总量,linethick0;
n5:sum(if(涨幅<=-5 and 涨幅>-6,vol,0),0)/总量,linethick0;
n4:sum(if(涨幅<=-4 and 涨幅>-5,vol,0),0)/总量,linethick0;
n3:sum(if(涨幅<=-3 and 涨幅>-4,vol,0),0)/总量,linethick0;
n2:sum(if(涨幅<=-2 and 涨幅>-3,vol,0),0)/总量,linethick0;
n1:sum(if(涨幅<=-1 and 涨幅>-2,vol,0),0)/总量,linethick0;
b0:sum(if(涨幅<=0 and 涨幅>-1,vol,0),0)/总量,linethick0;
p1:sum(if(涨幅<=1 and 涨幅>0,vol,0),0)/总量,linethick0;
p2:sum(if(涨幅<=2 and 涨幅>1,vol,0),0)/总量,linethick0;
p3:sum(if(涨幅<=3 and 涨幅>2,vol,0),0)/总量,linethick0;
p4:sum(if(涨幅<=4 and 涨幅>3,vol,0),0)/总量,linethick0;
p5:sum(if(涨幅<=5 and 涨幅>4,vol,0),0)/总量,linethick0;
p6:sum(if(涨幅<=6 and 涨幅>5,vol,0),0)/总量,linethick0;
p7:sum(if(涨幅<=7 and 涨幅>6,vol,0),0)/总量,linethick0;
p8:sum(if(涨幅<=8 and 涨幅>7,vol,0),0)/总量,linethick0;
p9:sum(if(涨幅<=9 and 涨幅>8,vol,0),0)/总量,linethick0;
p10:sum(if(涨幅<=10 and 涨幅>9,vol,0),0)/总量,linethick0;
DRAWRECTABS(265+200 ,125-n9*200, 275+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(277+200 ,125-n8*200, 287+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(290+200 ,125-n7*200, 300+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(302+200 ,125-n6*200, 312+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(315+200 ,125-n5*200, 325+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(327+200 ,125-n4*200, 337+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(340+200 ,125-n3*200, 350+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(352+200 ,125-n2*200, 362+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(365+200 ,125-n1*200, 375+200 ,125 ,RGB(0,0,255));
DRAWRECTABS(377+200 ,125-b0*200, 387+200 ,125 ,RGB(0,0,255));

DRAWRECTABS(390+200 ,125-p1*200, 400+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(402+200 ,125-p2*200, 412+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(415+200 ,125-p3*200, 425+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(427+200 ,125-p4*200, 437+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(440+200 ,125-p5*200, 450+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(452+200 ,125-p6*200, 462+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(465+200 ,125-p7*200, 475+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(477+200 ,125-p8*200, 487+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(490+200 ,125-p9*200, 500+200 ,125 ,RGB(255,0,0));
DRAWRECTABS(502+200 ,125-p10*200, 512+200 ,125 ,RGB(255,0,0));

发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口


相关内容


  • 上一篇教程:
  • 下一篇教程: