期货
返回模型
响应模型使用 camelCase 序列化名称;表中的字段名为 SDK 的 Rust 字段名。后续接口仅引用本节,避免重复列出模型。
FutureContractInfo
FutureContractInfo| 字段 | Rust 类型 | 说明 |
|---|---|---|
| continuous | bool | 是否连续合约 |
| trade | bool | 是否可交易 |
| r#type | String | 合约类型 |
| contract_code | String | 合约代码 |
| ib_code | String | IB 代码 |
| name | String | 合约名称 |
| contract_month | String | 合约月份 |
| last_trading_date | String | 最后交易日 |
| first_notice_date | String | 首个通知日 |
| last_bidding_close_time | i64 | 最后竞价收盘时间 |
| currency | String | 币种 |
| exchange_code | String | 交易所代码 |
| multiplier | f64 | 合约乘数 |
| min_tick | f64 | 最小变动价位 |
| display_multiplier | f64 | 展示乘数 |
| exchange | String | 交易所 |
| product_worth | String | 产品价值 |
| delivery_mode | String | 交割方式 |
| product_type | String | 产品类型 |
| product_scale | String | 产品规模 |
| last_trading_timestamp | i64 | 最后交易时间戳 |
DepthLevel
DepthLevel| 字段 | Rust 类型 | 说明 |
|---|---|---|
| price | f64 | 档位价格 |
| count | i32 | 档位订单数 |
| volume | i64 | 档位数量 |
FutureDepth
FutureDepth| 字段 | Rust 类型 | 说明 |
|---|---|---|
| contract_code | String | 合约代码 |
| timestamp | i64 | 行情时间戳 |
| asks | Vec<DepthLevel> | 卖方档位;见 DepthLevel |
| bids | Vec<DepthLevel> | 买方档位;见 DepthLevel |
FutureExchange
FutureExchange| 字段 | Rust 类型 | 说明 |
|---|---|---|
| code | String | 交易所代码 |
| name | String | 交易所名称 |
| zone_id | String | 时区 ID |
FutureMainContractHistory
FutureMainContractHistory| 字段 | Rust 类型 | 说明 |
|---|---|---|
| contract_code | String | 合约代码 |
| symbol | String | 标的代码 |
| begin_date | String | 生效开始日期 |
| end_date | String | 生效结束日期 |
FutureKlineItem
FutureKlineItem| 字段 | Rust 类型 | 说明 |
|---|---|---|
| time | i64 | K 线开始时间 |
| volume | i64 | 成交量 |
| open | f64 | 开盘价 |
| close | f64 | 收盘价 |
| high | f64 | 最高价 |
| low | f64 | 最低价 |
| last_time | i64 | 最后成交时间 |
| open_interest | i64 | 未平仓量 |
| settlement | f64 | 结算价 |
FutureKline
FutureKline| 字段 | Rust 类型 | 说明 |
|---|---|---|
| contract_code | String | 合约代码 |
| next_page_token | String | 下一页令牌 |
| items | Vec<FutureKlineItem> | K 线项目;见 FutureKlineItem |
FutureQuote
FutureQuote| 字段 | Rust 类型 | 说明 |
|---|---|---|
| contract_code | String | 合约代码 |
| latest_price | f64 | 最新价 |
| latest_size | i64 | 最新成交量 |
| latest_time | i64 | 最新成交时间 |
| bid_price | f64 | 买一价 |
| ask_price | f64 | 卖一价 |
| bid_size | i64 | 买一量 |
| ask_size | i64 | 卖一量 |
| open_interest | i64 | 未平仓量 |
| open_interest_change | i64 | 未平仓量变化 |
| volume | i64 | 成交量 |
| open | f64 | 开盘价 |
| high | f64 | 最高价 |
| low | f64 | 最低价 |
| settlement | f64 | 结算价 |
| limit_up | f64 | 涨停价 |
| limit_down | f64 | 跌停价 |
| avg_price | f64 | 均价 |
FutureTradeTickItem
FutureTradeTickItem| 字段 | Rust 类型 | 说明 |
|---|---|---|
| contract_code | String | 合约代码 |
| index | i64 | 逐笔索引 |
| time | i64 | 成交时间 |
| price | f64 | 成交价 |
| volume | i64 | 成交量 |
| direction | String | 成交方向 |
FutureTradingSegment
FutureTradingSegment| 字段 | Rust 类型 | 说明 |
|---|---|---|
| start | i64 | 时段开始时间 |
| end | i64 | 时段结束时间 |
| r#type | String | 时段类型 |
FutureTradingTime
FutureTradingTime| 字段 | Rust 类型 | 说明 |
|---|---|---|
| contract_code | String | 合约代码 |
| biz_date | String | 业务日期 |
| zone | String | 时区 |
| trading_times | Vec<FutureTradingSegment> | 交易时段;见 FutureTradingSegment |
获取所有期货合约
签名
pub async fn get_all_future_contracts( &self, req: AllFutureContractsRequest, ) -> Result<Vec<FutureContractInfo>, TigerError>
说明
按 contract_type/exchange 查询全部合约。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_type | Option<String> | 条件必填:contract_type / exchange 至少一个 | None(不序列化) |
| req.exchange | Option<String> | 条件必填:contract_type / exchange 至少一个 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureContractInfo>, TigerError>。字段见FutureContractInfo。
Vec<FutureContractInfo>
示例
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_all_future_contracts(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_all_future_contracts(AllFutureContractsRequest { contract_type: Some("ES".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"continuous": false,
"trade": true,
"type": "FUT",
"contractCode": "ES2509",
"ibCode": "ES",
"name": "E-mini S&P 500",
"contractMonth": "202509",
"lastTradingDate": "2025-09-19"
}
]获取当前合约
签名
pub async fn get_current_future_contract( &self, req: FutureContractSingleRequest, ) -> Result<Option<FutureContractInfo>, TigerError>
说明
当前主力;通常传 contract_type。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_code | Option<String> | 条件必填:contract_code / contract_type 至少一个 | None(不序列化) |
| req.contract_type | Option<String> | 条件必填:contract_code / contract_type 至少一个 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Option<FutureContractInfo>, TigerError>。字段见FutureContractInfo。
可空单个合约。
示例
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_current_future_contract(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_current_future_contract(FutureContractSingleRequest { contract_code: Some("ES2609".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
{
"continuous": false,
"trade": true,
"type": "FUT",
"contractCode": "ES2509",
"ibCode": "ES",
"name": "E-mini S&P 500",
"contractMonth": "202509",
"lastTradingDate": "2025-09-19"
}请求频率
基础限流为 120 次/分钟。
获取连续合约
签名
pub async fn get_future_continuous_contracts( &self, req: FutureContinuousContractsRequest, ) -> Result<Vec<FutureContractInfo>, TigerError>
说明
连续合约;contract_type 必填。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_type | Option<String> | 可选 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureContractInfo>, TigerError>。字段见FutureContractInfo。
Vec<FutureContractInfo>
示例
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_future_continuous_contracts(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_continuous_contracts(FutureContinuousContractsRequest { contract_type: Some("ES".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"continuous": false,
"trade": true,
"type": "FUT",
"contractCode": "ES2509",
"ibCode": "ES",
"name": "E-mini S&P 500",
"contractMonth": "202509",
"lastTradingDate": "2025-09-19"
}
]请求频率
基础限流为 120 次/分钟。
获取期货合约
签名
pub async fn get_future_contract( &self, req: FutureContractSingleRequest, ) -> Result<Vec<FutureContractInfo>, TigerError>
说明
按 contract_code 或 contract_type 查询;单对象也统一为 Vec。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_code | Option<String> | 条件必填:contract_code / contract_type 至少一个 | None(不序列化) |
| req.contract_type | Option<String> | 条件必填:contract_code / contract_type 至少一个 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureContractInfo>, TigerError>。字段见FutureContractInfo。
Vec<FutureContractInfo>
示例
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_future_contract(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_contract(FutureContractSingleRequest { contract_code: Some("ES2609".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"continuous": false,
"trade": true,
"type": "FUT",
"contractCode": "ES2509",
"ibCode": "ES",
"name": "E-mini S&P 500",
"contractMonth": "202509",
"lastTradingDate": "2025-09-19"
}
]请求频率
基础限流为 120 次/分钟。
获取期货合约列表
签名
pub async fn get_future_contracts( &self, exchange_code: &str, ) -> Result<Vec<FutureContractInfo>, TigerError>
说明
按交易所查合约;代码必填。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| exchange_code | &str | 必填 | 无 |
返回
QuoteClient:Result<Vec<FutureContractInfo>, TigerError>。字段见FutureContractInfo。
合约代码、月份、交易日、币种、乘数、tick、交易所。
示例
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_future_contracts(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_contracts("CME").await?;
Ok(())
}
返回示例
[
{
"continuous": false,
"trade": true,
"type": "FUT",
"contractCode": "ES2509",
"ibCode": "ES",
"name": "E-mini S&P 500",
"contractMonth": "202509",
"lastTradingDate": "2025-09-19"
}
]请求频率
基础限流为 120 次/分钟。
获取期货深度行情
签名
pub async fn get_future_depth( &self, req: FutureDepthRequest, ) -> Result<Vec<FutureDepth>, TigerError>
说明
盘口;contract_codes 必填。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_codes | Option<Vec<String>> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureDepth>, TigerError>。字段及嵌套档位见FutureDepth和DepthLevel。
合约代码及买卖档位。
示例
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_future_depth(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_depth(FutureDepthRequest { contract_codes: Some(vec!["ES2609".into()]), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"contractCode": "ES2509",
"timestamp": 1738180800000,
"asks": [
{
"price": 5638.25,
"volume": 120
},
{
"price": 5638.5,
"volume": 85
}
],
"bids": [
{
"price": 5638.0,
"volume": 95
},
{
"price": 5637.75,
"volume": 110
}
]
}
]获取期货交易所
签名
pub async fn get_future_exchange(&self) -> Result<Vec<FutureExchange>, TigerError>
说明
支持的期货交易所,无参数。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| none | - | Rust 类型必填 | 无 |
返回
QuoteClient:Result<Vec<FutureExchange>, TigerError>。字段见FutureExchange。
code/name/zone_id。
示例
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_future_exchange(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_exchange().await?;
Ok(())
}
返回示例
[
{
"code": "CME",
"name": "Chicago Mercantile Exchange",
"zoneId": "America/Chicago"
}
]请求频率
基础限流为 10 次/分钟。
获取历史主力合约
签名
pub async fn get_future_history_main_contract( &self, req: FutureHistoryMainContractRequest, ) -> Result<Vec<FutureMainContractHistory>, TigerError>
说明
历史主力;合约代码与毫秒时间窗。
Rust SDK 使用的 wire 方法 future_main_contract 未在当前服务端注册,因此该调用不受支持。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_codes | Option<Vec<String>> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.begin_time | Option<i64> | 可选 | None(不序列化) |
| req.end_time | Option<i64> | 可选 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureMainContractHistory>, TigerError>。字段见FutureMainContractHistory。
contract_code/symbol/begin_date/end_date。
示例
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_future_history_main_contract(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_history_main_contract(FutureHistoryMainContractRequest { contract_codes: Some(vec!["ES2609".into()]), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"contractCode": "ES2509",
"symbol": "ES",
"beginDate": "2025-06-20",
"endDate": "2025-09-19"
}
]获取期货 K 线
签名
pub async fn get_future_kline( &self, mut req: FutureKlineRequest, ) -> Result<Vec<FutureKline>, TigerError>
说明
K 线;代码与周期必填;时间 Some(0) 被 SDK 改为 Some(-1)。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_codes | Option<Vec<String>> | 条件必填:contract_code / contract_codes 至少一个 | None(不序列化) |
| req.contract_code | Option<String> | 条件必填:contract_code / contract_codes 至少一个 | None(不序列化) |
| req.period | Option<String> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.begin_time | Option<i64> | 可选 | Some(0) 时 SDK 设为 Some(-1) |
| req.end_time | Option<i64> | 可选 | Some(0) 时 SDK 设为 Some(-1) |
| req.begin_index | Option<i32> | 可选 | None(不序列化) |
| req.end_index | Option<i32> | 可选 | None(不序列化) |
| req.limit | Option<i32> | 可选 | None(不序列化) |
| req.page_token | Option<String> | 可选 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureKline>, TigerError>。字段及嵌套 K 线见FutureKline和FutureKlineItem。
contract_code/next_page_token/items。
示例
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_future_kline(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_kline(FutureKlineRequest { contract_code: Some("ES2609".into()), period: Some("day".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"contractCode": "ES2509",
"nextPageToken": "eyJzIjoiMTczODE4MDgwMDAwMCJ9",
"items": [
{
"time": 1738094400000,
"volume": 1423500,
"open": 5610.25,
"close": 5638.0,
"high": 5645.75,
"low": 5605.25,
"lastTime": 1738180799000,
"openInterest": 2150000,
"settlement": 5635.5
}
]
}
]请求频率
基础限流为 60 次/分钟。本页使用 future_kline 的方法共享此额度。
分页获取期货 K 线
签名
pub async fn get_future_kline_by_page( &self, req: FutureKlineByPageRequest, ) -> Result<Vec<FutureKlineItem>, TigerError>
说明
客户端分页;page_size=200、total_size=1000;空时间按 -1。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_code | Option<String> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.period | Option<String> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.begin_time | Option<i64> | 可选 | None(不序列化) |
| req.end_time | Option<i64> | 可选 | None(不序列化) |
| req.total_size | Option<i32> | 可选 | None 时 1000 |
| req.page_size | Option<i32> | 可选 | None 时 200 |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureKlineItem>, TigerError>。字段见FutureKlineItem。
扁平 Vec<FutureKlineItem>。
示例
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_future_kline_by_page(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_kline_by_page(FutureKlineByPageRequest { contract_code: Some("ES2609".into()), period: Some("day".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"time": 1738180800000,
"volume": 58263100,
"open": 5620.5,
"close": 5638.0,
"high": 5645.75,
"low": 5605.25,
"lastTime": 1738180800000,
"openInterest": 2150000
}
]请求频率
基础限流为 60 次/分钟。本页使用 future_kline 的方法共享此额度。
获取期货实时行情
签名
pub async fn get_future_real_time_quote( &self, req: FutureRealTimeQuoteRequest, ) -> Result<Vec<FutureQuote>, TigerError>
说明
快照;contract_codes 必填;需期货行情权限。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_codes | Option<Vec<String>> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureQuote>, TigerError>。字段见FutureQuote。
最新价、买卖价量、成交量、持仓、OHLC、结算及涨跌停。
示例
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_future_real_time_quote(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_real_time_quote(FutureRealTimeQuoteRequest { contract_codes: Some(vec!["ES2609".into()]), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"contractCode": "ES2509",
"latestPrice": 5638.0,
"latestSize": 15,
"latestTime": 1738180800000,
"bidPrice": 5638.0,
"askPrice": 5638.25,
"bidSize": 300,
"askSize": 300
}
]请求频率
基础限流为 120 次/分钟。
获取期货逐笔成交
签名
pub async fn get_future_trade_ticks( &self, req: FutureTradeTicksRequest, ) -> Result<Vec<FutureTradeTickItem>, TigerError>
说明
v3 逐笔;contract_code 必填;end_index SDK 默认 30。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_code | Option<String> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.begin_index | Option<i32> | 可选 | None(不序列化) |
| req.end_index | Option<i32> | 可选 | None 时 SDK 设为 30 |
| req.limit | Option<i32> | 可选 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Vec<FutureTradeTickItem>, TigerError>。字段见FutureTradeTickItem。
contract_code/index/time/price/volume/direction。
示例
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_future_trade_ticks(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_trade_ticks(FutureTradeTicksRequest { contract_code: Some("ES2609".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
[
{
"contractCode": "ES2509",
"index": 1,
"time": 1738180800000,
"price": 195.5,
"volume": 58263100,
"direction": "BUY"
}
]请求频率
基础限流为 120 次/分钟。
获取期货交易时间
签名
pub async fn get_future_trading_times( &self, req: FutureTradingTimesRequest, ) -> Result<Option<FutureTradingTime>, TigerError>
说明
交易时段;contract_code 必填,交易日可选。
参数
| 参数 | Rust 类型 | 必填性/条件 | SDK 默认值 |
|---|---|---|---|
| req.contract_code | Option<String> | 服务端必填;SDK 不预校验 | None(不序列化) |
| req.trading_date | Option<String> | 可选 | None(不序列化) |
| req.lang | Option<String> | 可选 | None(不序列化) |
返回
QuoteClient:Result<Option<FutureTradingTime>, TigerError>。字段及嵌套时段见FutureTradingTime和FutureTradingSegment。
contract_code/biz_date/zone/trading_times(start,end,type)。
示例
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_future_trading_times(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = quote.get_future_trading_times(FutureTradingTimesRequest { contract_code: Some("ES2609".into()), ..Default::default() }).await?;
Ok(())
}
返回示例
{
"contractCode": "ES2509",
"bizDate": "2025-01-29",
"zone": "America/Chicago",
"tradingTimes": [
{
"start": 1738015800000,
"end": 1738094400000,
"type": "TRADING"
},
{
"start": 1738094400000,
"end": 1738101600000,
"type": "POST_MARKET"
}
]
}请求频率
基础限流为 60 次/分钟。
Updated about 1 month ago
