期权

返回模型

响应模型使用 camelCase 序列化名称;表中的字段名为 SDK 的 Rust 字段名。后续接口仅引用本节,避免重复列出模型。

ImpliedVolMetric

字段Rust 类型说明
periodString指标周期
percentilef64分位数
rankf64排名

OptionVolatilityPoint

字段Rust 类型说明
implied_volf64隐含波动率
percentilef64分位数
rankf64排名
his_volatilityf64历史波动率
timestampi64Unix 毫秒时间戳

OptionAnalysis

字段Rust 类型说明
symbolString标的代码
implied_vol30_daysf6430 日隐含波动率
his_volatilityf64历史波动率
iv_his_v_ratiof64IV/HV 比率
call_put_ratiof64看涨/看跌比率
implied_vol_metricOption<ImpliedVolMetric>隐含波动率指标;见 ImpliedVolMetric
volatility_listVec<OptionVolatilityPoint>波动率时序;见 OptionVolatilityPoint

OptionLeg

字段Rust 类型说明
identifierString期权标识符
strikeString行权价
rightString期权方向
bid_pricef64买一价
bid_sizei64买一量
ask_pricef64卖一价
ask_sizei64卖一量
volumei64成交量
latest_pricef64最新价
pre_closef64昨收价
open_interesti64未平仓量
multiplieri32合约乘数
last_timestampi64最后行情时间戳
implied_volf64隐含波动率
deltaf64Delta(已废弃)
gammaf64Gamma(已废弃)
thetaf64Theta(已废弃)
vegaf64Vega(已废弃)
rhof64Rho(已废弃)
mark_pricef64标记价
pre_mark_pricef64昨标记价
mark_timestampi64标记价时间戳
mid_pricef64中间价
pre_mid_pricef64昨中间价
mid_timestampi64中间价时间戳

OptionChainRow

字段Rust 类型说明
putOption<OptionLeg>Put 腿;见 OptionLeg
callOption<OptionLeg>Call 腿;见 OptionLeg

OptionChain

字段Rust 类型说明
symbolString标的代码
expiryi64到期时间戳
itemsVec<OptionChainRow>Put/Call 配对;见 OptionChainRow

DepthLevel

字段Rust 类型说明
pricef64档位价格
counti32档位订单数
volumei64档位数量

Depth

字段Rust 类型说明
symbolString期权代码
asksVec<DepthLevel>卖方档位;见 DepthLevel
bidsVec<DepthLevel>买方档位;见 DepthLevel

OptionExpiration

字段Rust 类型说明
symbolString标的代码
option_symbolsVec<String>期权代码列表
datesVec<String>到期日列表
timestampsVec<i64>到期时间戳列表
periodsVec<String>到期周期列表
countsVec<i32>对应合约数量列表

KlineItem

字段Rust 类型说明
timei64K 线开始时间
volumei64成交量
volume_decimalOption<f64>小数成交量
openf64开盘价
closef64收盘价
highf64最高价
lowf64最低价
amountf64成交额

Kline(OptionKline 别名)

字段Rust 类型说明
symbolString期权代码
periodStringK 线周期
next_page_tokenString下一页令牌
itemsVec<KlineItem>K 线项目;见 KlineItem

Brief(OptionBrief 别名)

字段Rust 类型说明
symbolString期权代码
openf64开盘价
highf64最高价
lowf64最低价
closef64收盘价
pre_closef64昨收价
latest_pricef64最新价
latest_timei64最新成交时间
ask_pricef64卖一价
ask_sizei64卖一量
bid_pricef64买一价
bid_sizei64买一量
volumei64成交量
statusString状态
adj_pre_closef64复权昨收价
changef64涨跌额
change_ratef64涨跌幅
amplitudef64振幅
expiryString到期日;SDK 可由字符串或数字反序列化
strikeString行权价
rightString期权方向
multiplieri32合约乘数
open_interesti64未平仓量

OptionSymbol

字段Rust 类型说明
symbolString标的代码
marketString市场
nameString名称
name_cnString中文名称
name_enString英文名称
underlying_symbolString标的代码

TimelineItem

字段Rust 类型说明
timei64分时点时间
volumei64成交量
volume_decimalOption<f64>小数成交量
pricef64价格
avg_pricef64均价

TimelineBucket

字段Rust 类型说明
itemsVec<TimelineItem>分时点;见 TimelineItem

Timeline

字段Rust 类型说明
symbolString期权代码
periodString分时周期
pre_closef64昨收价
intradayOption<TimelineBucket>盘中分时;见 TimelineBucket
pre_hoursOption<TimelineBucket>盘前分时;见 TimelineBucket
after_hoursOption<TimelineBucket>盘后分时;见 TimelineBucket

TradeTickItem

字段Rust 类型说明
timei64成交时间
volumei64成交量
pricef64成交价
r#typeString成交类型
part_codeString参与方代码
part_nameString参与方名称
condString成交条件

TradeTick

字段Rust 类型说明
symbolString期权代码
begin_indexi64起始索引
end_indexi64结束索引
itemsVec<TradeTickItem>逐笔项目;见 TradeTickItem

获取期权分析

签名


pub async fn get_option_analysis( &self, req: OptionAnalysisRequest, ) -> Result<Vec<OptionAnalysis>, TigerError>

说明

symbols 与 symbol_items 二选一;后者优先;可请求波动率序列。

参数

参数Rust 类型必填性/条件SDK 默认值
req.symbolsOption<Vec<String>>条件必填:symbols / symbol_items 至少一个None(不序列化)
req.symbol_itemsOption<Vec<OptionAnalysisSymbol>>条件必填:symbols / symbol_items 至少一个None(不序列化)
req.marketOption<String>可选None(不序列化)
req.periodOption<String>可选None(不序列化)
req.require_volatility_listOption<bool>可选None(不序列化)
req.langOption<String>可选None(不序列化)

返回

implied_vol30_days/his_volatility/iv_his_v_ratio/call_put_ratio/implied_vol_metric/volatility_list。

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_analysis(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_analysis(OptionAnalysisRequest { symbols: Some(vec!["AAPL".into()]), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "impliedVol30Days": 0.2845,
    "hisVolatility": 0.213,
    "ivHisVRatio": 1.3356,
    "callPutRatio": 1.52,
    "impliedVolMetric": null,
    "volatilityList": [
      {
        "period": "30d",
        "impliedVol": 0.2845,
        "hisVolatility": 0.213
      }
    ]
  }
]

请求频率

基础限流为 60 次/分钟。


获取期权链

签名


pub async fn get_option_chain( &self, req: OptionChainRequest, ) -> Result<Vec<OptionChain>, TigerError>

说明

v3 期权链;option_basic 必填;范围筛选边界由 RangeF64/RangeI32 表示。

已废弃:return_greek_value、option_filter.greeks 以及返回 leg 中的 delta、gamma、theta、vega、rho 均已废弃。这些值每日更新,不适合盘中决策;新代码不要设置这些参数或依赖这些返回字段。

参数

参数Rust 类型必填性/条件SDK 默认值
req.option_basicOption<Vec<OptionChainItem>>服务端必填;SDK 不预校验None(不序列化)
req.marketOption<String>可选None(不序列化)
req.langOption<String>可选None(不序列化)
req.return_greek_valueOption<bool>已废弃;不要设置None(不序列化)
req.option_filterOption<OptionChainFilter>可选;其中 greeks 已废弃None(不序列化)

返回

symbol/expiry/items(call,put);leg 含报价、持仓量和 IV;Greeks 字段已废弃,不应依赖。每个 leg(OptionChainRow)还包含:mark_price: f64(标记价)、pre_mark_price: f64(昨标记价)、mark_timestamp: i64(标记价时间戳,毫秒)、mid_price: f64(中间价)、pre_mid_price: f64(昨中间价)、mid_timestamp: i64(中间价时间戳,毫秒)。

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_chain(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_chain(OptionChainRequest { option_basic: Some(Default::default()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "expiry": 1740096000000,
    "items": [
      {
        "strike": 195.0,
        "call": {
          "symbol": "AAPL 250221C00195000",
          "latestPrice": 3.45,
          "volume": 12500,
          "openInterest": 35000
        },
        "put": {
          "symbol": "AAPL 250221P00195000",
          "latestPrice": 2.8,
          "volume": 9800,
          "openInterest": 28000
        }
      }
    ]
  }
]

请求频率

基础限流为 60 次/分钟。



获取期权深度行情

签名


pub async fn get_option_depth( &self, req: OptionDepthRequest, ) -> Result<Vec<Depth>, TigerError>

说明

获取期权订单簿;option_basic 必填;需深度行情权限。

参数

参数Rust 类型必填性/条件SDK 默认值
req.option_basicOption<Vec<OptionQueryItem>>服务端必填;SDK 不预校验None(不序列化)
req.marketOption<String>可选None(不序列化)
req.langOption<String>可选None(不序列化)

返回

  • QuoteClient: Result<Vec<Depth>, TigerError>。字段及嵌套档位见 Depth 和 DepthLevel。

Vec<Depth>

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_depth(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_depth(OptionDepthRequest { option_basic: Some(Default::default()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "asks": [
      {
        "price": 195.51,
        "volume": 200
      },
      {
        "price": 195.52,
        "volume": 350
      }
    ],
    "bids": [
      {
        "price": 195.49,
        "volume": 150
      },
      {
        "price": 195.48,
        "volume": 400
      }
    ]
  }
]

获取期权到期日

签名


pub async fn get_option_expiration( &self, symbols: &[&str], market: Option<&str>, ) -> Result<Vec<OptionExpiration>, TigerError>

说明

到期日;symbols 非空;港股传 Some("HK")。

参数

参数Rust 类型必填性/条件SDK 默认值
symbols&[&str]必填无
marketOption<&str>可选None(不序列化)

返回

  • QuoteClient: Result<Vec<OptionExpiration>, TigerError>。字段见 OptionExpiration。

symbol/dates/timestamps/option_symbols/periods/counts。

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_expiration(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_expiration(&["AAPL"], None).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "optionSymbols": ["AAPL 250221C00195000", "AAPL 250221P00195000"],
    "dates": ["2025-02-21", "2025-03-21"],
    "timestamps": [1740096000000, 1742515200000],
    "periods": ["weekly", "monthly"],
    "counts": [42, 56]
  }
]

指数期权的特殊代码

  • 标普 500(.SPX):月度期权符号为 SPX,周期权和季度期权为 SPXW。
  • 纳斯达克 100:月度期权为 NDX,周期权为 NDXP。
  • VIX 指数:月度期权为 VIX,周期权为 VIXW。

请求频率

基础限流为 60 次/分钟。


获取期权 K 线

签名


pub async fn get_option_kline( &self, req: OptionKlineRequest, ) -> Result<Vec<OptionKline>, TigerError>

说明

v2 K 线;option_query 必填;item 的 sort_dir/时间窗/limit 可选。

参数

参数Rust 类型必填性/条件SDK 默认值
req.option_queryOption<Vec<OptionKlineItem>>服务端必填;SDK 不预校验None(不序列化)
req.marketOption<String>可选None(不序列化)
req.langOption<String>可选None(不序列化)

返回

  • QuoteClient: Result<Vec<OptionKline>, TigerError>,其中 OptionKline = Kline。字段及嵌套 K 线见 Kline 和 KlineItem。

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_kline(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_kline(OptionKlineRequest { option_query: Some(Default::default()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "value": 94836000000.0
  }
]

请求频率

基础限流为 60 次/分钟。


获取期权行情

签名


pub async fn get_option_quote( &self, req: OptionQuoteRequest, ) -> Result<Vec<OptionBrief>, TigerError>

说明

v2 快照;option_basic 必填,可用 OptionContractItem::from_occ。

已废弃别名:get_option_brief 是本方法的转发别名,SDK 自 0.5.1 起标记 #[deprecated],无额外行为。新代码请直接使用 get_option_quote。

参数

参数Rust 类型必填性/条件SDK 默认值
req.option_basicOption<Vec<OptionContractItem>>服务端必填;SDK 不预校验None(不序列化)
req.marketOption<String>可选None(不序列化)
req.langOption<String>可选None(不序列化)

返回

  • QuoteClient: Result<Vec<OptionBrief>, TigerError>,其中 OptionBrief = Brief。字段见 Brief。

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_quote(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_quote(OptionQuoteRequest { option_basic: Some(Default::default()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "value": 94836000000.0
  }
]

请求频率

基础限流为 120 次/分钟。


获取期权代码

签名


pub async fn get_option_symbols( &self, req: OptionSymbolsRequest, ) -> Result<Vec<OptionSymbol>, TigerError>

说明

港股期权代码列表;通常 market=HK。

参数

参数Rust 类型必填性/条件SDK 默认值
req.marketOption<String>服务端必填;SDK 不预校验None(不序列化)
req.langOption<String>可选None(不序列化)

返回

  • QuoteClient: Result<Vec<OptionSymbol>, TigerError>。字段见 OptionSymbol。

代码、市场、名称、标的代码。

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_symbols(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_symbols(OptionSymbolsRequest { market: Some("US".into()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "market": "US",
    "name": "AAPL Options",
    "nameCn": "苹果期权",
    "nameEn": "AAPL Options",
    "underlyingSymbol": "AAPL"
  }
]

获取期权分时

签名


pub async fn get_option_timeline( &self, req: OptionTimelineRequest, ) -> Result<Vec<Timeline>, TigerError>

说明

期权分时;option_query 必填。

参数

参数Rust 类型必填性/条件SDK 默认值
req.option_queryOption<Vec<OptionQueryItem>>服务端必填;SDK 不预校验None(不序列化)
req.marketOption<String>可选None(不序列化)
req.langOption<String>可选None(不序列化)

返回

Vec<Timeline>

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_timeline(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_timeline(OptionTimelineRequest { option_query: Some(Default::default()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "period": "day",
    "preClose": 192.53,
    "intraday": null,
    "preHours": null,
    "afterHours": null
  }
]


获取期权逐笔成交

签名


pub async fn get_option_trade_ticks( &self, req: OptionTradeTicksRequest, ) -> Result<Vec<TradeTick>, TigerError>

说明

期权逐笔;contracts 必填,每项为 OptionQueryItem。

参数

参数Rust 类型必填性/条件SDK 默认值
req.contractsOption<Vec<OptionQueryItem>>服务端必填;SDK 不预校验None(不序列化)
req.langOption<String>可选None(不序列化)

返回

Vec<TradeTick>

示例


use std::sync::Arc;

use tigeropen::client::http_client::HttpClient;

use tigeropen::config::ClientConfig;

use tigeropen::error::TigerError;

use tigeropen::model::order::*;

use tigeropen::model::quote::*;

use tigeropen::model::quote_requests::*;

use tigeropen::model::trade_requests::*;

use tigeropen::push::*;

use tigeropen::quote::QuoteClient;

use tigeropen::trade::TradeClient;

async fn example_get_option_trade_ticks(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {

    let result_0 = quote.get_option_trade_ticks(OptionTradeTicksRequest { contracts: Some(Default::default()), ..Default::default() }).await?;

    Ok(())

}

返回示例

[
  {
    "symbol": "AAPL",
    "beginIndex": 0,
    "endIndex": 30,
    "items": [
      {
        "time": 1738180750000,
        "price": 195.5,
        "volume": 100,
        "type": "+"
      },
      {
        "time": 1738180745000,
        "price": 195.49,
        "volume": 50,
        "type": "-"
      }
    ]
  }
]

请求频率

基础限流为 120 次/分钟。



Did this page help you?