# 獲取自選股分組

get_user_security_group(group_type = UserSecurityGroupType.ALL)

  • 介紹

    獲取自選股分組列表

  • 參數

    參數 類型 説明
    group_type UserSecurityGroupType 分組類型
  • 返回

    參數 類型 説明
    ret RET_CODE 介面呼叫結果
    data pd.DataFrame 當 ret == RET_OK,返回自選股分組數據
    str 當 ret != RET_OK,返回錯誤描述
    • 自選股分組數據格式如下:
      欄位 類型 説明
      group_name str 分組名
      group_type UserSecurityGroupType 分組類型
  • Example

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

ret, data = quote_ctx.get_user_security_group(group_type = UserSecurityGroupType.ALL)
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close() # 結束後記得關閉當條連接,防止連接條數用盡
1
2
3
4
5
6
7
8
9
  • Output
        group_name group_type
0          期權     SYSTEM
..         ...        ...
12          C     CUSTOM

[13 rows x 2 columns]
1
2
3
4
5
6

介面限制

  • 每 30 秒內最多請求 10 次獲取自選股分組介面