股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[大智慧] 大智慧的分笔时段资金进出统计公式(源码、贴图)


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-3-21 17:10:24
大智慧的分笔时段资金进出统计公式(源码、贴图)介绍

大智慧的分笔时段资金进出统计公式(源码、贴图)

主要是统计某一段时间的大中小单资金进出情况,包括主动买盘和被动买盘的一些统计,此指标有一定的参考价值,希望对大家有用。

(150万):=REF((((sum(buyvol*c*(AMOUNT>=1000000),0))+(-sum(sellvol*c*(AMOUNT>=1000000),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
(100万):=REF((((sum(buyvol*c*((AMOUNT>=700000)and(AMOUNT<1000000)),0))+(-sum(sellvol*c*((AMOUNT>=700000)and(AMOUNT<1000000)),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
(70万):=REF((((sum(buyvol*c*((AMOUNT>=500000)and(AMOUNT<700000)),0))+(-sum(sellvol*c*((AMOUNT>=500000)and(AMOUNT<700000)),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
(50万):=REF((((sum(buyvol*c*((AMOUNT>=300000)and(AMOUNT<500000)),0))+(-sum(sellvol*c*((AMOUNT>=300000)and(AMOUNT<500000)),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
(30万):=REF((((sum(buyvol*c*((AMOUNT>=100000)and(AMOUNT<300000)),0))+(-sum(sellvol*c*((AMOUNT>=100000)and(AMOUNT<300000)),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
(10万):=REF((((sum(buyvol*c*((AMOUNT>=50000)and(AMOUNT<100000)),0))+(-sum(sellvol*c*((AMOUNT>=50000)and(AMOUNT<100000)),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
(5万):=REF((((sum(buyvol*c*(AMOUNT<50000),0))+(-sum(sellvol*c*(AMOUNT<50000),0)))*100/10000),BARSLAST(((092500)<TIME)and((113000)>TIME)));
总:=(150万)+(100万)+(70万)+(50万)+(30万)+(10万)+(5万);
IF BARSTATUS=2 and (总) THEN BEGIN DRAWTEXTREL(20,355,' 总净买入:'+NUMTOSTRN(总,2)),LINETHICK1,COLORccffcc;end;
IF BARSTATUS=2 and ((5万)) THEN BEGIN DRAWTEXTREL(20,480,' 5 万以下大单净买入:'+NUMTOSTRN((5万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((10万)) THEN BEGIN DRAWTEXTREL(20,520,' 5→10 万大单净买入:'+NUMTOSTRN((10万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((30万)) THEN BEGIN DRAWTEXTREL(20,570,' 10→30 万大单净买入:'+NUMTOSTRN((30万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((50万)) THEN BEGIN DRAWTEXTREL(20,620,' 30→50 万大单净买入:'+NUMTOSTRN((50万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((70万)) THEN BEGIN DRAWTEXTREL(20,670,' 50→70 万大单净买入:'+NUMTOSTRN((70万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((100万)) THEN BEGIN DRAWTEXTREL(20,720,'70→100 万大单净买入:'+NUMTOSTRN((100万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((150万)) THEN BEGIN DRAWTEXTREL(20,760,'100 万以上大单净买入:'+NUMTOSTRN((150万),2)),LINETHICK1,COLORred;end;
DRAWTEXTREL(30,250,' 早盘9:25-11:30统计:');
(150v万):=(((sum(buyvol*c*(AMOUNT>=1000000),0))+(-sum(sellvol*c*(AMOUNT>=1000000),0)))*100/10000);
(100v万):=(((sum(buyvol*c*((AMOUNT>=700000)and(AMOUNT<1000000)),0))+(-sum(sellvol*c*((AMOUNT>=700000)and(AMOUNT<1000000)),0)))*100/10000);
(70v万):=(((sum(buyvol*c*((AMOUNT>=500000)and(AMOUNT<700000)),0))+(-sum(sellvol*c*((AMOUNT>=500000)and(AMOUNT<700000)),0)))*100/10000);
(50v万):=(((sum(buyvol*c*((AMOUNT>=300000)and(AMOUNT<500000)),0))+(-sum(sellvol*c*((AMOUNT>=300000)and(AMOUNT<500000)),0)))*100/10000);
(30v万):=(((sum(buyvol*c*((AMOUNT>=100000)and(AMOUNT<300000)),0))+(-sum(sellvol*c*((AMOUNT>=100000)and(AMOUNT<300000)),0)))*100/10000);
(10v万):=(((sum(buyvol*c*((AMOUNT>=50000)and(AMOUNT<100000)),0))+(-sum(sellvol*c*((AMOUNT>=50000)and(AMOUNT<100000)),0)))*100/10000);
(5v万):=(((sum(buyvol*c*(AMOUNT<50000),0))+(-sum(sellvol*c*(AMOUNT<50000),0)))*100/10000);
v1:=(150v万)-(150万);
v2:=(100v万)-(100万);
v3:=(70v万)-(70万);
v4:=(50v万)-(50万);
v5:=(30v万)-(30万);
v6:=(10v万)-(10万);
v7:=(5v万)-(5万);
总v:=v1+v2+v3+v4+v5+v6+v7;
IF BARSTATUS=2 and (总v) THEN BEGIN DRAWTEXTREL(350,355,'‖ 总净买入:'+NUMTOSTRN(总v,2)),LINETHICK1,COLORccffcc;end;
IF BARSTATUS=2 and (v7) THEN BEGIN DRAWTEXTREL(350,480,'‖ 5 万以下大单净买入:'+NUMTOSTRN(v7,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v6) THEN BEGIN DRAWTEXTREL(350,520,'‖ 5→10 万大单净买入:'+NUMTOSTRN(v6,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v5) THEN BEGIN DRAWTEXTREL(350,570,'‖ 10→30 万大单净买入:'+NUMTOSTRN(v5,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v4) THEN BEGIN DRAWTEXTREL(350,620,'‖ 30→50 万大单净买入:'+NUMTOSTRN(v4,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v3) THEN BEGIN DRAWTEXTREL(350,670,'‖ 50→70 万大单净买入:'+NUMTOSTRN(v3,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v2) THEN BEGIN DRAWTEXTREL(342,720,' ‖70→100 万大单净买入:'+NUMTOSTRN(v2,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v1) THEN BEGIN DRAWTEXTREL(342,760,' ‖100 万以上大单净买入:'+NUMTOSTRN(v1,2)),LINETHICK1,COLORred;end;
DRAWTEXTREL(350,250,'‖ 午盘13:00-15:00统计:');
总vv:=(150v万)+(100v万)+(70v万)+(50v万)+(30v万)+(10v万)+(5v万);
IF BARSTATUS=2 and (总vv) THEN BEGIN DRAWTEXTREL(680,355,'‖ 总净买入:'+NUMTOSTRN(总vv,2)),LINETHICK1,COLORccffcc;end;
IF BARSTATUS=2 and ((5万)) THEN BEGIN DRAWTEXTREL(680,480,'‖ 5 万以下大单净买入:'+NUMTOSTRN((5v万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((10v万)) THEN BEGIN DRAWTEXTREL(680,520,'‖ 5→10 万大单净买入:'+NUMTOSTRN((10v万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((30v万)) THEN BEGIN DRAWTEXTREL(680,570,'‖ 10→30 万大单净买入:'+NUMTOSTRN((30v万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((50v万)) THEN BEGIN DRAWTEXTREL(680,620,'‖ 30→50 万大单净买入:'+NUMTOSTRN((50v万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((70v万)) THEN BEGIN DRAWTEXTREL(680,670,'‖ 50→70 万大单净买入:'+NUMTOSTRN((70v万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((100v万)) THEN BEGIN DRAWTEXTREL(673,720,' ‖70→100 万大单净买入:'+NUMTOSTRN((100v万),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and ((150v万)) THEN BEGIN DRAWTEXTREL(673,760,' ‖100 万以上大单净买入:'+NUMTOSTRN((150v万),2)),LINETHICK1,COLORred;end;
DRAWTEXTREL(680,250,'‖ 全天9:25-15:00统计:');
b3:=(sum((c*buyvol)*100/10000,0))-(-sum((c*sellvol)*100/10000,0));
IF BARSTATUS=2 and (b3) THEN BEGIN DRAWTEXTREL(10,123,'■总成金额(万元):'+NUMTOSTRN(b3,2)),LINETHICK4,COLORccffcc;end;
主动买:=sum(c*buyvol,0);
主动卖:=sum(c*sellvol,0);
主买均价(元):主动买/sum(buyvol,0),linethick0,colorred;
主卖均价(元):主动卖/sum(sellvol,0),linethick0,colorgreen;
总均价(元):(主买均价(元)+主卖均价(元))/2,linethick0,colorwhite;
IF BARSTATUS=2 and (主买均价(元)) THEN BEGIN DRAWTEXTREL(380,50,' 主买盘均价(元):'+NUMTOSTRN(主买均价(元),2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (主卖均价(元)) THEN BEGIN DRAWTEXTREL(380,100,' 主卖盘均价(元):'+NUMTOSTRN(主卖均价(元),2)),LINETHICK1,COLORgreen;end;
IF BARSTATUS=2 and (总均价(元)) THEN BEGIN DRAWTEXTREL(380,160,' 总均价(元):'+NUMTOSTRN(总均价(元),2)),LINETHICK1,COLORwhite;end;
b1:=REF((sum(buyvol,0)),BARSLAST(((092500)<TIME)and((113000)>TIME)));
s1:=REF((sum(sellvol,0)),BARSLAST(((092500)<TIME)and((113000)>TIME)));
b2:=sum(buyvol,0);
s2:=sum(sellvol,0);
v8:=b2-b1;
v9:=s2-s1;
v10:=b1-s1;
v11:=v8-v9;
v12:=b2-s2;
IF BARSTATUS=2 and (b1) THEN BEGIN DRAWTEXTREL(20,820,' 外盘:'+NUMTOSTRN(b1,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (s1) THEN BEGIN DRAWTEXTREL(20,862,' 内盘:'+NUMTOSTRN(s1,2)),LINETHICK1,COLORgreen;end;
IF BARSTATUS=2 and (v10) THEN BEGIN DRAWTEXTREL(20,923,' 外内盘净量:'+NUMTOSTRN(v10,2)),LINETHICK1,COLORwhite;end;
IF BARSTATUS=2 and (v8) THEN BEGIN DRAWTEXTREL(343,825,' ‖外盘:'+NUMTOSTRN(v8,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (v9) THEN BEGIN DRAWTEXTREL(343,866,' ‖内盘:'+NUMTOSTRN(v9,2)),LINETHICK1,COLORgreen;end;
IF BARSTATUS=2 and (v11) THEN BEGIN DRAWTEXTREL(343,925,' ‖外内盘净量:'+NUMTOSTRN(v11,2)),LINETHICK1,COLORwhite;end;
IF BARSTATUS=2 and (b2) THEN BEGIN DRAWTEXTREL(673,820,' ‖外盘(主动买量):'+NUMTOSTRN(b2,2)),LINETHICK1,COLORred;end;
IF BARSTATUS=2 and (s2) THEN BEGIN DRAWTEXTREL(673,862,' ‖内盘(主动卖量):'+NUMTOSTRN(s2,2)),LINETHICK1,COLORgreen;end;
IF BARSTATUS=2 and (v12) THEN BEGIN DRAWTEXTREL(673,928,' ‖外内盘净量:'+NUMTOSTRN(v12,2)),LINETHICK1,COLORwhite;end;
b1:=sum(BIDVOL(1),0);
bv:=sum(buyvol,0);
s1:=-sum(ASKVOL(1),0);
s2:=sum(ASKVOL(1),0);
sv:=-sum(sellvol,0);
sv1:=sum(sellvol,0);
bs:=bv+sv;
bs1:=b1+s1;
IF BARSTATUS=2 and (b1) THEN BEGIN DRAWTEXTREL(680,50,'‖ 被动买入总量:'+NUMTOSTRN(b1,2)),LINETHICK1,color0050ff;end;
IF BARSTATUS=2 and (s2) THEN BEGIN DRAWTEXTREL(680,100, '‖ 被动卖出总量;'+NUMTOSTRN(s2,2)),LINETHICK1,color008900;end;
IF BARSTATUS=2 and (bs) THEN BEGIN DRAWTEXTREL(680,150,'‖ 主动净买入:'+NUMTOSTRN(bs,2)),LINETHICK1,COLORRED;end;
IF BARSTATUS=2 and (bs1) THEN BEGIN DRAWTEXTREL(680,200, '‖ 被动净买入;'+NUMTOSTRN(bs1,2)),LINETHICK1,color0050ff;end;
STICKLINE((b1 AND DISPSTATUS=2),0,b1,150,0),color0050ff;
STICKLINE((bv AND DISPSTATUS=2),0,bv,100,0),COLORred;
STICKLINE((s1 AND DISPSTATUS=2),0,s1,150,0),color008900;
STICKLINE((sv AND DISPSTATUS=2),0,sv,100,0),colorgreen;




 



gd16702

回复

举报

QQ|

GMT+8, 2024-11-17 19:50

快速回复 返回顶部 返回列表