# Get Top Ten Buy/Sell Brokers

get_top_ten_buy_sell_brokers(code, days_before=None)

  • Description

    Get the top ten net buy and net sell broker lists for the specified HK stock (real-time or historical)

  • Parameters

    Parameter Type Description
    code str Stock code
    days_before int Historical days
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data pd.DataFrame When ret == RET_OK, returns broker data DataFrame
    str When ret != RET_OK, returns error description
    • DataFrame fields:

      Field Type Description
      is_real_time bool Whether real-time data
      data_time int Data update timestamp
      data_time_str str Data update time string
      net_vol int Net buy/sell volume
      broker_name str Broker display name
      buy_sell_type BuySellType Buy/sell type
      avg_price float Average trade price
      total_vol float Total trade volume
      total_turnover float Total trade turnover
  • BuySellType Enum

    Enum Name Value Description
    Unknown 0 Unknown
    NetBuy 1 Net buy
    NetSell 2 Net sell
  • 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

Restrictions

  • Maximum 30 requests per 30 seconds.
  • HK stocks only (equities and funds).
  • days_before=0 or omitted returns real-time data (includes avg price / total volume / total turnover); days_before>0 returns net volume and broker name only.