# 機関保有の業種分布を取得します

get_institution_distribution(market, institution_id)

  • 説明

    機関保有の業種分布を取得します。指定機関の保有を業種別に分類した時価総額と比率データを返します。

  • パラメータ

    パラメータ タイプ 説明
    market Market 市場タイプ(HK/US)(必須)
    institution_id int 機関ID(get_institution_list から取得)(必須)
  • 戻り値

    パラメータ タイプ 説明
    ret RET_CODE API呼び出し結果
    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

API制限

  • 30秒以内に最大60回のリクエストが可能です
  • ページネーションリクエストは最初のページのみレート制限にカウントされます