Skip to content

期權篩選

POST /v1/quote/option-screen

期權篩選器:在指定的市場品類(美股/港股/日股 x 股票/指數/期貨)下,按 strategy 表達的多組條件(標的、行權價、到期日、期權方向、希臘字母、隱含波動率、鏈統計等)從全市場期權合約中篩選,支持排序與分頁。

請求參數

參數類型位置必填說明
strategyobject請求體篩選策略,結構 {market_category_list, filter_group_list}market_category_list 取值:0=US_STOCK / 1=US_INDEX / 2=US_FUTURE / 3=HK_STOCK / 4=HK_INDEX / 5=JP_STOCK / 6=JP_INDEX(多元素並集)。filter_group_list 多組取交集,單組內同字段 indicator 數組取並集;單組只能在 underlying_list / option_list / chain_list / combo_list 中選 1 個非空。
strategy_paramobject請求體策略附加參數。僅當策略以自選股或選股策略結果作為標的來源時必傳:watch_stock_id_list:[uint64] / stock_screener_stock_id_list:[uint64]
field_filterobject請求體聲明需要返回的指標字段。不傳時僅返回預設 4 字段(volume / price / chg_ratio / implied_volatility)+ option_id。int 字段用 1 佔位,string 字段用字符串佔位(如 "x")。嵌套字段按 proto 字段名聲明,例 underlying_info:{iv:1, hv:1}
sort_objobject請求體排序方式 {sort_field: OptionItem, is_asc}sort_field 只設置 1 個字段(如 {"volume":1})。is_asc 非 0 升序,0/不傳降序。不傳時按 volume 降序。
next_keystring請求體翻頁游標,首頁留空;回傳上一頁 pagination.next_key
limitint請求體單頁返回條數,預設 100,最大 1000;可傳 0(僅查詢總數,配合 request_exact_data=0)。
request_exact_dataint請求體是否需要精確明細:0=只返回總數(option_list 為空),1=返回明細列表(預設)。

請求示例

bash
curl -X POST "$ip/v1/quote/option-screen" \
  -H "Content-Type: application/json" \
  -d '{
    "strategy": {
      "market_category_list": [0],
      "filter_group_list": [
        {"underlying_list":[{"indicator_type":101,"indicator_value":{"value_list":[205189]}}]},
        {"option_list":[{"indicator_type":1003,"indicator_value":{"value_list":[1]}}]}
      ]
    },
    "field_filter": {
      "hp_strike_price": 1, "option_type": 1, "exercise_type": 1, "expiration_type": 1,
      "in_the_money": 1, "left_day": 1, "price": 1, "volume": 1, "delta": 1,
      "implied_volatility": 1, "option_name": "x",
      "underlying_info": {"price": 1, "iv": 1, "iv_rank": 1}
    },
    "sort_obj": {"sort_field": {"volume": 1}},
    "next_key": "",
    "limit": 5
  }' | jq

響應字段

合約通用字段:

字段類型說明
codestring期權合約 code,例 US.AAPL260115C00200000
option_namestring期權合約名稱,例 AAPL 260526 312.50C
strike_pricedouble行權價(已除 1e9 還原)。
strike_datestring行權日期,格式 yyyyMMdd
strike_date_timestampint64行權日時間戳(毫秒)。
option_typestring期權方向:CALL / PUT
exercise_typestring行權方式:AMERICAN / EUROPEAN
expiration_typestring到期類型:WEEK / MONTH / QUARTER 等。
in_the_moneystring實值/虛值:IN_THE_MONEY / OUT_OF_THE_MONEY
left_dayint距離到期天數。
multiplierdouble合約乘數(已除 1e9)。
contract_share_sizedouble每張合約股數(已除 1e9)。
product_codestring期權鏈 product_code。

行情與盤口字段:

字段類型說明
pricedouble最新價(已除 1e9)。
mid_pricedouble買賣中間價(已除 1e9)。
bid_pricedouble買一價(已除 1e9)。
ask_pricedouble賣一價(已除 1e9)。
bid_ask_spreaddouble買賣價差(已除 1e9)。
bid_volumeint買一量。
ask_volumeint賣一量。
change_ratiodouble漲跌幅(百分數,已除 1e5)。
volumeint成交量。
turnoverdouble成交額(已除 1e3)。
open_interestint未平倉量。

波動率與希臘字母:

字段類型說明
implied_volatilitydouble隱含波動率(百分數,已除 1e5)。
history_volatilitydouble歷史波動率(百分數,已除 1e5)。
deltadoubleDelta(已除 1e5)。
gammadoubleGamma(已除 1e5)。
vegadoubleVega(已除 1e5)。
thetadoubleTheta(已除 1e5)。
rhodoubleRho(已除 1e5)。
leverage_ratiodouble槓桿比率(已除 1e5)。

標的統計 underlying:

字段類型說明
underlying.stock_iduint64標的 stock_id。
underlying.volumeint標的全部期權總成交量。
underlying.open_interestint標的全部期權總持倉量。
underlying.ivdouble標的 IV(百分數,已除 1e5)。
underlying.hvdouble標的 HV-30 日(百分數,已除 1e5)。
underlying.iv_rankdoubleIV Rank(百分數,已除 1e5)。
underlying.pricedouble標的最新價(已除 1e9)。
underlying.change_ratiodouble標的漲跌幅(百分數,已除 1e5)。

分頁:

字段類型說明
pagination.has_morebool是否還有更多數據。
pagination.next_keystring下一頁游標;無更多頁為 "-1"
pagination.totalint滿足條件的期權總數(request_exact_data=0 時上限 9999)。

限制範圍

  • 支持的市場品類:US_STOCK / US_INDEX / US_FUTURE / HK_STOCK / HK_INDEX / JP_STOCK / JP_INDEX。
  • 非支持的 market_category 數值會被後端靜默忽略,返回空 option_list 與 pagination.total=0
  • strategy 必填;filter_group_list 單組內 underlying_list / option_list / chain_list / combo_list 只能 1 個非空。
  • 分頁:不透明 next_key 游標;limit 取值範圍 [0, 1000]。
  • request_exact_data=0pagination.total 上限 9999,且 option_list 必為空(僅查總數)。
  • min_value / max_value 超過 2^53 時建議傳字符串(行權價 x1e9 後易越界)。

錯誤碼

ret_codeerror.code觸發條件處理建議
-3invalid_parameter缺必填 strategylimit 越界(>1000);next_key 非法;field_filter 子字段類型與 proto 不一致;strategy 內 indicator 取值非法。校正請求體後重試。
1permission_denied用戶無期權篩選權限。檢查賬戶行情/期權權限。
-5backend_biz_error後端業務異常。稍後重試或聯繫服務方。

響應示例

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "option_list": [
      {
        "code": "US.AAPL260526C00312500",
        "option_name": "AAPL 260526 312.50C",
        "strike_price": 312.5,
        "option_type": "CALL",
        "exercise_type": "AMERICAN",
        "expiration_type": "WEEK",
        "in_the_money": "IN_THE_MONEY",
        "left_day": 5,
        "price": 0.01,
        "volume": 108815,
        "delta": 0.01459,
        "implied_volatility": 3.27059,
        "underlying_info": {
          "price": 200.5,
          "iv": 32.5,
          "iv_rank": 45.3
        }
      }
    ]
  },
  "pagination": { "has_more": true, "next_key": "5", "total": 1923817 }
}