# 获取机构持仓行业分布

get_institution_distribution(market, institution_id)

  • 介绍

    获取机构持仓行业分布,返回指定机构的持仓按行业分类的市值和占比数据。

  • 参数

    参数 类型 说明
    market Market 市场类型(HK/US)(必填)
    institution_id int 机构 ID(从 get_institution_list 获取)(必填)
  • 返回

    参数 类型 说明
    ret RET_CODE 接口调用结果
    data pd.DataFrame 当 ret == RET_OK,返回数据
    str 当 ret != RET_OK,返回错误描述
    • 数据格式如下:
      字段 类型 说明
      industry_id int 行业 ID
      industry_name str 行业名称
      position_value float 持仓市值
      portfolio_pct float 行业占比(%)
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

# 先获取机构ID
ret, data, _, _ = quote_ctx.get_institution_list(market=Market.US, count=1)
if ret == RET_OK and len(data) > 0:
    inst_id = data.iloc[0]['institution_id']

    # 查询行业分布
    ret, data = quote_ctx.get_institution_distribution(market=Market.US, institution_id=inst_id)
    if ret == RET_OK:
        print(data)
    else:
        print('error:', data)

quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  • Output
industry_id industry_name        position_value  portfolio_pct
0           6            电子  1319006433351.533936        19.8494
1          26           计算机   992844462205.649048        14.9411
2          12          医药生物   633746255374.343994         9.5371
3          27        互联网与传媒   484195469416.382996         7.2865
4          19          非银金融   481223610387.026001         7.2418
5         N/A            其他                   N/A        41.1441
1
2
3
4
5
6
7

接口限制

  • 30 秒内最多 60 次请求
  • 分页请求仅首页计入限频统计