# 期權標的排行

get_option_underlying_rank(option_market, sort_type, sort_direction=None, count=None, trading_date=None, filter_list=None, page=None)

  • 介紹

    獲取期權熱門標的排行,按指定維度對期權標的(正股/ETF/指數)進行排名,支持多維度篩選與分頁。

  • 參數

    參數 類型 說明
    option_market OptionMarket 期權市場類型
    sort_type UnderlyingRankSortType 排序字段
    sort_direction int 排序方向
    count int 每頁數量
    trading_date str 交易日
    filter_list list[UnderlyingRankFilter] 篩選條件列表
    page str 分頁遊標
  • 篩選器(UnderlyingRankFilter)

    透過 UnderlyingRankFilter 構造篩選條件,多個條件為 AND 關係。

    UnderlyingRankFilter(indicator_type, value_list=None, interval_min=None, interval_max=None,
                         min_inclusive=True, max_inclusive=True, security_list=None)
    
    1
    2
    參數 類型 說明
    indicator_type UnderlyingRankIndicatorType 篩選因子類型
    value_list list 確切值列表(枚舉值或整數)
    interval_min float 區間下限
    interval_max float 區間上限
    min_inclusive bool 下限是否閉區間,默認 True
    max_inclusive bool 上限是否閉區間,默認 True
    security_list list[str] 證券代碼列表
    • 篩選因子(完整枚舉見 UnderlyingRankIndicatorType),按篩選方式分組:

      篩選方式 用哪個參數 適用因子 語義
      security_list security_list OWNER_LIST 只看指定標的
      value_list value_list STOCK_CATEGORY 命中品類枚舉
      範圍 interval_min / interval_max IVIV_RANKIV_PERCENTILEIV_CHANGEHVHV_CHANGEVOLUMEOPEN_INTERESTVOLUME_RATIOOI_RATIOMARKET_CAP 落在區間內
  • 返回

    參數 類型 說明
    ret RET_CODE 接口調用結果
    data pandas.DataFrame 當 ret == RET_OK,返回排行數據
    str 當 ret != RET_OK,返回錯誤描述
    next_page str 下一頁遊標字符串,None 表示無下一頁
    all_count int 符合條件的總數據量
    • data DataFrame 字段:

      字段 類型 說明
      code str 標的股票代碼
      name str 標的名稱
      total_volume int 期權總成交量
      total_open_interest int 期權總持倉量
      volume_ratio float Put/Call 成交量比值(百分比)
      open_interest_ratio float Put/Call 持倉量比值(百分比)
      iv float 隱含波動率(百分比)
      iv_rank float IV 排名百分位(百分比)
      iv_percentile float IV 百分位(百分比)
      price float 標的最新價
      change_ratio float 標的漲跌幅(小數)
      iv_change float IV 變化率(百分比)
      hv float 歷史波動率(百分比)
      hv_change float HV 變化率(百分比)
      market_cap float 市值
      trading_date str 排行數據對應交易日
      trading_timestamp float 排行數據對應交易日時間戳(Unix 秒)
  • Example

from futu import *

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

# 篩選器用法引導(按需取消註釋,構造後傳入 filter_list,多條件為 AND 關係):
# # ① 標的列表篩選 — 只排指定標的
# f_owner = UnderlyingRankFilter(UnderlyingRankIndicatorType.OWNER_LIST,
#                                security_list=['US.TSLA', 'US.AAPL', 'US.NVDA'])
# # ② 確切值篩選 — 只要 ETF 標的
# f_cat = UnderlyingRankFilter(UnderlyingRankIndicatorType.STOCK_CATEGORY,
#                              value_list=[StockCategory.ETF])
# # ③ 範圍篩選 — IV Rank > 50%(入參用小數 0.5)、持倉量 P/C 比值 > 1(偏空)
# f_ivrank = UnderlyingRankFilter(UnderlyingRankIndicatorType.IV_RANK, interval_min=0.5)
# f_pcr = UnderlyingRankFilter(UnderlyingRankIndicatorType.OI_RATIO, interval_min=1.0)

ret, data, next_page, all_count = quote_ctx.get_option_underlying_rank(
    option_market=OptionMarket.US_SECURITY,
    sort_type=UnderlyingRankSortType.VOLUME,
    count=5
    # filter_list=[f_cat, f_ivrank]   # 多條件 AND,傳入上方構造的篩選條件
)
if ret == RET_OK:
    print(data)
    print('all_count:', all_count)
else:
    print('error:', data)

quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  • Output
      code                        name  total_volume  total_open_interest  volume_ratio  open_interest_ratio      iv  iv_rank  iv_percentile   price  change_ratio  iv_change      hv  hv_change    market_cap trading_date  trading_timestamp
0   US.SPY               標普500ETF-SPDR      14228830             19909256       0.97899              1.93868  17.675   27.143         61.111  741.75      0.540826     -8.261  15.031     -0.057  7.814945e+11   2026-06-12       1.781237e+09
1   US.QQQ  納指100ETF-Invesco QQQ Trust       8239190             12964422       0.99417              1.49888  27.652   62.918         91.269  721.34      0.588465     -8.332  26.196     -0.644  4.765533e+11   2026-06-12       1.781237e+09
2  US.TSLA                         特斯拉       3623504              7088459       0.64872              0.69633  55.053   39.265         64.285  406.43      1.823876     -0.629  49.359     -1.194  1.526439e+12   2026-06-12       1.781237e+09
3  US.NVDA                         英偉達       3157331             16744961       0.59428              0.84085  41.975   27.062         42.460  205.19      0.156197     -7.002  45.921     -1.972  4.965598e+12   2026-06-12       1.781237e+09
4   US.IWM           羅素2000ETF-iShares       2840729             11791964       0.79034              2.78276  24.857   33.930         64.285  292.95      0.874626     -6.744  24.802      0.522  8.061984e+10   2026-06-12       1.781237e+09
all_count: 6017
1
2
3
4
5
6
7

接口限制

  • 30 秒內最多請求 60 次期權標的排行接口(支持分頁的接口,僅首次調用納入統計)