赞
踩
qmt更加详细的教程方法,会持续慢慢梳理。
也可找寻博主的历史文章,搜索关键词查看解决方案 !
感谢关注,需免费开通量化回测与咨询实盘权限,可以和博主联系!
获取一只或者多只股票在一个时间段内的资金流向数据
提示
1.该数据通过get_market_data
和get_market_data_ex
接口获取,period参数选择transactioncount1d
或者 transactioncount1m
2.获取历史数据前需要先用download_history_data
下载历史数据
3.VIP 权限数据
原型
原生python
- # 逐笔成交统计日级
- get_market_data_ex([],stock_list,period="transactioncount1d",start_time = "", end_time = "")
- # 逐步成交统计1分钟级
- get_market_data_ex([],stock_list,period="transactioncount1m",start_time = "", end_time = "")
参数
参数名称 | 类型 | 描述 |
---|---|---|
field_list | list | 数据字段列表,传空则为全部字段 |
stock_list | list | 合约代码列表 |
period | string | 周期 |
start_time | string | 起始时间 |
end_time | string | 结束时间 |
count | int | 数据个数。默认参数,大于等于0时,若指定了 start_time ,end_time ,此时以 end_time 为基准向前取 count 条;若 start_time ,end_time 缺省,默认取本地数据最新的 count 条数据;若 start_time ,end_time ,count 都缺省时,默认取本地全部数据 |
dividend_type | string | 除权方式 |
fill_data | bool | 是否向后填充空缺数据 |
field_list
字段可选:提示
特大单:成交金额大于或等于100万元或成交量大于或等于5000手
大单:成交金额大于或等于20万元或成交量大于或等于1000手
中单:成交金额大于或等于4万元或成交量大于或等于200手
小单:其它为小单
字段名 | 数据类型 | 含义 |
---|---|---|
time | int | 时间戳 |
bidNumber | int | 主买单总单数 |
bidMostVolume | int | 主买特大单成交量 |
bidBigVolume | int | 主买大单成交量 |
bidMediumVolume | int | 主买中单成交量 |
bidSmallVolume | int | 主买小单成交量 |
offNumber | int | 主卖单总单数 |
offMostVolume | int | 主卖特大单成交量 |
offBigVolume | int | 主卖大单成交量 |
offMediumVolume | int | 主卖中单成交量 |
offSmallVolume | int | 主卖小单成交量 |
bidMostAmount | float | 主买特大单成交额 |
bidBigAmount | float | 主买大单成交额 |
bidMediumAmount | float | 主买中单成交额 |
bidSmallAmount | float | 主买小单成交额 |
offMostAmount | float | 主卖特大单成交额 |
offBigAmount | float | 主卖大单成交额 |
offMediumAmount | float | 主卖中单成交额 |
offSmallAmount | float | 主卖小单成交额 |
ddx | float | 大单动向 |
ddy | float | 涨跌动因 |
ddz | float | 大单差分 |
zjbyNetInflow | int | 资金博弈 净流入 |
zjbyMost | int | 资金博弈 超大单 |
zjbyBig | int | 资金博弈 大单 |
zjbyMedium | int | 资金博弈 中单 |
zjbySmall | int | 资金博弈 小单 |
netOrder | int | 净挂 |
netWithdraw | int | 净撤 |
withdrawBid | int | 总撤买 |
withdrawOff | int | 总撤卖 |
unactiveBidMostVolume | int | 被动买特大单成交量 |
unactiveBidBigVolume | int | 被动买大单成交量 |
unactiveBidMediumVolume | int | 被动买中单成交量 |
unactiveBidSmallVolume | int | 被动买小单成交量 |
unactiveOffMostVolume | int | 被动卖特大单成交量 |
unactiveOffBigVolume | int | 被动卖大单成交量 |
unactiveOffMediumVolume | int | 被动卖中单成交量 |
unactiveOffSmallVolume | int | 被动卖小单成交量 |
unactiveBidMostAmount | float | 被动买特大单成交额 |
unactiveBidBigAmount | float | 被动买大单成交额 |
unactiveBidMediumAmount | float | 被动买中单成交额 |
unactiveBidSmallAmount | float | 被动买小单成交额 |
unactiveOffMostAmount | float | 被动卖特大单成交额 |
unactiveOffBigAmount | float | 被动卖大单成交额 |
unactiveOffMediumAmount | float | 被动卖中单成交额 |
unactiveOffSmallAmount | float | 被动卖小单成交额 |
返回
返回一个 {stock_code
:pd.DataFrame
} 结构的dict
对象,默认的列索引为取得的全部字段. 如果给定了 fields
参数, 则列索引与给定的 fields
对应.
示例
示例
- from xtquant import xtdata
-
- # 获取历史数据前,请确保已经下载历史数据
- xtdata.download_history_data("000001.SZ",period="transactioncount1d")
- xtdata.download_history_data("000582.SZ",period="transactioncount1d")
-
- # 获取一只股票在一个时间段内的资金流量数据
- data1 = xtdata.get_market_data_ex([],["000001.SZ"],period="transactioncount1d",start_time = "20230101", end_time = "20231009")
-
- # 获取多只股票在一个时间段内的资金流向数据
- data2 = xtdata.get_market_data_ex([],["000001.SZ","000582.SZ"],period="transactioncount1d",start_time = "20230101", end_time = "20231009")
- # 获取多只股票在某一天的资金流向数据
- data3 = xtdata.get_market_data_ex([],["000001.SZ","000582.SZ"],period="transactioncount1d",start_time = "20231009", end_time = "20231009")
data1返回值
- {'000001.SZ': time bidNumber bidMostVolume bidBigVolume \
- 20230919000000 1695052800000 984 69117 44872
- 20230921000000 1695225600000 895 108902 83679
- 20230925000000 1695571200000 1623 231467 74114
- 20230926000000 1695657600000 2062 67169 55677
- 20230927000000 1695744000000 2009 58878 62465
-
- bidMediumVolume bidSmallVolume offNumber offMostVolume \
- 20230919000000 26438 6501 1967 85488
- 20230921000000 35465 3924 983 229549
- 20230925000000 43191 10924 2505 187342
- 20230926000000 51364 17352 2249 116657
- 20230927000000 56459 14777 1309 81739
-
- offBigVolume offMediumVolume ... unactiveOffMediumVolume \
- 20230919000000 59203 59738 ... 26438
- 20230921000000 86736 32368 ... 35465
- 20230925000000 122762 72830 ... 43191
- 20230926000000 60107 56529 ... 51364
- 20230927000000 45153 35564 ... 56459
-
- unactiveOffSmallVolume unactiveBidMostAmount \
- 20230919000000 6501 95675555.0
- 20230921000000 3924 254330642.0
- 20230925000000 10924 210680989.0
- 20230926000000 17352 130480050.0
- 20230927000000 14777 91271341.0
-
- unactiveBidBigAmount unactiveBidMediumAmount \
- 20230919000000 66298552.0 66894672.0
- 20230921000000 96037439.0 35829510.0
- 20230925000000 138055328.0 81832159.0
- 20230926000000 67243196.0 63224375.0
- 20230927000000 50446231.0 39734344.0
-
- unactiveBidSmallAmount unactiveOffMostAmount \
- 20230919000000 15027131.0 77417455.0
- 20230921000000 6162863.0 120659362.0
- 20230925000000 20874412.0 260444433.0
- 20230926000000 22504832.0 75270646.0
- 20230927000000 9942591.0 65804316.0
-
- unactiveOffBigAmount unactiveOffMediumAmount \
- 20230919000000 50235300.0 29606244.0
- 20230921000000 92703643.0 39276977.0
- 20230925000000 83333817.0 48529084.0
- 20230926000000 62328071.0 57432804.0
- 20230927000000 69814571.0 63092343.0
-
- unactiveOffSmallAmount
- 20230919000000 7278898.0
- 20230921000000 4345184.0
- 20230925000000 12272276.0
- 20230926000000 19401833.0
- 20230927000000 16510431.0
-
- [5 rows x 47 columns]}
data2返回值
- {'000001.SZ': time bidNumber bidMostVolume bidBigVolume \
- 20230919000000 1695052800000 984 69117 44872
- 20230921000000 1695225600000 895 108902 83679
- 20230925000000 1695571200000 1623 231467 74114
- 20230926000000 1695657600000 2062 67169 55677
- 20230927000000 1695744000000 2009 58878 62465
-
- bidMediumVolume bidSmallVolume offNumber offMostVolume \
- 20230919000000 26438 6501 1967 85488
- 20230921000000 35465 3924 983 229549
- 20230925000000 43191 10924 2505 187342
- 20230926000000 51364 17352 2249 116657
- 20230927000000 56459 14777 1309 81739
-
- offBigVolume offMediumVolume ... unactiveOffMediumVolume \
- 20230919000000 59203 59738 ... 26438
- 20230921000000 86736 32368 ... 35465
- 20230925000000 122762 72830 ... 43191
- 20230926000000 60107 56529 ... 51364
- 20230927000000 45153 35564 ... 56459
-
- unactiveOffSmallVolume unactiveBidMostAmount \
- 20230919000000 6501 95675555.0
- 20230921000000 3924 254330642.0
- 20230925000000 10924 210680989.0
- 20230926000000 17352 130480050.0
- 20230927000000 14777 91271341.0
-
- unactiveBidBigAmount unactiveBidMediumAmount \
- 20230919000000 66298552.0 66894672.0
- 20230921000000 96037439.0 35829510.0
- 20230925000000 138055328.0 81832159.0
- 20230926000000 67243196.0 63224375.0
- 20230927000000 50446231.0 39734344.0
-
- unactiveBidSmallAmount unactiveOffMostAmount \
- 20230919000000 15027131.0 77417455.0
- 20230921000000 6162863.0 120659362.0
- 20230925000000 20874412.0 260444433.0
- 20230926000000 22504832.0 75270646.0
- 20230927000000 9942591.0 65804316.0
-
- unactiveOffBigAmount unactiveOffMediumAmount \
- 20230919000000 50235300.0 29606244.0
- 20230921000000 92703643.0 39276977.0
- 20230925000000 83333817.0 48529084.0
- 20230926000000 62328071.0 57432804.0
- 20230927000000 69814571.0 63092343.0
-
- unactiveOffSmallAmount
- 20230919000000 7278898.0
- 20230921000000 4345184.0
- 20230925000000 12272276.0
- 20230926000000 19401833.0
- 20230927000000 16510431.0
-
- [5 rows x 47 columns],
- '000582.SZ': time bidNumber bidMostVolume bidBigVolume \
- 20231009000000 1696780800000 1235 1822 7834
-
- bidMediumVolume bidSmallVolume offNumber offMostVolume \
- 20231009000000 13594 11220 1158 0
-
- offBigVolume offMediumVolume ... unactiveOffMediumVolume \
- 20231009000000 13378 19074 ... 13594
-
- unactiveOffSmallVolume unactiveBidMostAmount \
- 20231009000000 11220 0.0
-
- unactiveBidBigAmount unactiveBidMediumAmount \
- 20231009000000 10446929.0 14883956.0
-
- unactiveBidSmallAmount unactiveOffMostAmount \
- 20231009000000 9972652.0 1419544.0
-
- unactiveOffBigAmount unactiveOffMediumAmount \
- 20231009000000 6119272.0 10617787.0
-
- unactiveOffSmallAmount
- 20231009000000 8753931.0
-
- [1 rows x 47 columns]}
data3返回值
- {'000582.SZ': time bidNumber bidMostVolume bidBigVolume \
- 20231009000000 1696780800000 1235 1822 7834
-
- bidMediumVolume bidSmallVolume offNumber offMostVolume \
- 20231009000000 13594 11220 1158 0
-
- offBigVolume offMediumVolume ... unactiveOffMediumVolume \
- 20231009000000 13378 19074 ... 13594
-
- unactiveOffSmallVolume unactiveBidMostAmount \
- 20231009000000 11220 0.0
-
- unactiveBidBigAmount unactiveBidMediumAmount \
- 20231009000000 10446929.0 14883956.0
-
- unactiveBidSmallAmount unactiveOffMostAmount \
- 20231009000000 9972652.0 1419544.0
-
- unactiveOffBigAmount unactiveOffMediumAmount \
- 20231009000000 6119272.0 10617787.0
-
- unactiveOffSmallAmount
- 20231009000000 8753931.0
-
- [1 rows x 47 columns],
- '000001.SZ': time bidNumber bidMostVolume bidBigVolume \
- 20231009000000 1696780800000 1720 124493 91717
-
- bidMediumVolume bidSmallVolume offNumber offMostVolume \
- 20231009000000 52939 12295 2691 193122
-
- offBigVolume offMediumVolume ... unactiveOffMediumVolume \
- 20231009000000 120549 79591 ... 52939
-
- unactiveOffSmallVolume unactiveBidMostAmount \
- 20231009000000 12295 214620203.0
-
- unactiveBidBigAmount unactiveBidMediumAmount \
- 20231009000000 133821821.0 88366888.0
-
- unactiveBidSmallAmount unactiveOffMostAmount \
- 20231009000000 23450520.0 138450770.0
-
- unactiveOffBigAmount unactiveOffMediumAmount \
- 20231009000000 101823002.0 58774037.0
-
- unactiveOffSmallAmount
- 20231009000000 13652109.0
-
- [1 rows x 47 columns]}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。