# 獲取十大經紀商買賣數據

get_top_ten_buy_sell_brokers(code, days_before=None)

  • 介紹

    獲取指定港股的十大淨買入和淨賣出經紀商列表(實時或歷史)

  • 參數

    參數 類型 說明
    code str 股票代碼
    days_before int 歷史天數
  • 回傳

    參數 類型 說明
    ret RET_CODE 介面調用結果
    data pd.DataFrame 當 ret == RET_OK,回傳經紀商數據 DataFrame
    str 當 ret != RET_OK,回傳錯誤描述
    • DataFrame 欄位說明:

      欄位 類型 說明
      is_real_time bool 是否實時數據
      data_time int 數據更新時間戳(秒級 Unix 時間戳)
      data_time_str str 數據更新時間字串
      net_vol int 淨買賣量
      broker_name str 經紀商名稱
      buy_sell_type BuySellType 買賣類型
      avg_price float 成交均價
      total_vol float 總成交量
      total_turnover float 總成交額
  • BuySellType 枚舉

    枚舉名 說明
    Unknown 0 未知
    NetBuy 1 淨買入
    NetSell 2 淨賣出
  • Example

from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

ret, data = quote_ctx.get_top_ten_buy_sell_brokers("HK.00700")
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
  • Output
net_vol  is_real_time  buy_sell_type  ...   avg_price total_vol total_turnover
0     99200          True              1  ...  466.852156  398800.0    186180640.0
1     46500          True              1  ...  466.508972   61300.0     28597000.0
2     45400          True              1  ...  466.224332   67400.0     31423520.0
3     36000          True              1  ...  467.343428  240400.0    112349360.0
4     31300          True              1  ...  466.900580  155100.0     72416280.0
5     30000          True              1  ...  465.546667   30000.0     13966400.0
6     15000          True              1  ...  466.809333   15000.0      7002140.0
7     13700          True              1  ...  466.816577   55500.0     25908320.0
8     12300          True              1  ...  466.557724   12300.0      5738660.0
9      9200          True              1  ...  466.217391    9200.0      4289200.0
10  -373700          True              2  ...  467.064060  414300.0    193504640.0
11  -235100          True              2  ...  466.822072  502900.0    234764820.0
12  -168100          True              2  ...  466.281052  311900.0    145433060.0
13  -138300          True              2  ...  467.436639  547500.0    255921560.0
14   -89800          True              2  ...  466.722515  265600.0    123961500.0
15   -79400          True              2  ...  466.431910   79600.0     37127980.0
16   -69700          True              2  ...  466.950688   94500.0     44126840.0
17   -43600          True              2  ...  466.546230   61000.0     28459320.0
18   -25300          True              2  ...  466.652174   25300.0     11806300.0
19   -19500          True              2  ...  466.124484   33900.0     15801620.0

[20 rows x 9 columns]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

介面限制

  • 每 30 秒內最多請求 30 次。
  • 僅支援港股正股及基金。
  • days_before=0 或不填回傳實時數據(含均價/總量/總額),days_before>0 僅含淨量和經紀商名稱。