期货
示例上下文
import { createClientConfig, QuoteClient } from '@tigeropenapi/tigeropen';
const config = createClientConfig();
const quoteClient = QuoteClient.fromConfig(config);获取期货交易所
签名
async getFutureExchange(): Promise<FutureExchange[]>用途
查询 future exchange。
参数、默认值与约束
无参数。
返回
Promise<FutureExchange[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| code | string | 交易所代码 |
| name | string | 名称 |
| zoneId | string | 时区 ID |
示例
const result = await quoteClient.getFutureExchange();
console.log(result);返回示例
[
{
"code": "string",
"name": "string",
"zoneId": "string"
}
]获取期货合约列表
签名
async getFutureContracts(exchange: string): Promise<FutureContractInfo[]>用途
查询 future contracts。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
exchange | string | 是 | None | — |
返回
Promise<FutureContractInfo[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| continuous | boolean | 是否连续合约 |
| trade | boolean | 是否可交易 |
| type | string | 合约类型 |
| contractCode | string | 合约代码 |
| ibCode | string | IB 代码 |
| name | string | 名称 |
| contractMonth | string | 合约月份 |
| lastTradingDate | string | 最后交易日 |
| firstNoticeDate | string | 第一通知日 |
| lastBiddingCloseTime | number | 最后竞价截止时间 |
| currency | string | 币种 |
| exchangeCode | string | 交易所代码 |
| multiplier | number | 合约乘数 |
| minTick | number | 最小变动单位 |
| displayMultiplier | number | 显示乘数 |
| exchange | string | 交易所 |
| productWorth | string | 合约价值 |
| deliveryMode | string | 交割方式 |
| productType | string | 产品类型 |
| productScale | string | 产品精度 |
| lastTradingTimestamp | number | 最后交易时间戳 |
示例
const result = await quoteClient.getFutureContracts('CME');
console.log(result);返回示例
[
{
"continuous": "boolean",
"trade": "boolean",
"type": "string",
"contractCode": "string",
"ibCode": "string",
"name": "string",
"contractMonth": "string",
"lastTradingDate": "string",
"firstNoticeDate": "string",
"lastBiddingCloseTime": 0,
"currency": "string",
"exchangeCode": "string",
"multiplier": 0,
"minTick": 0,
"displayMultiplier": 0,
"exchange": "string",
"productWorth": "string",
"deliveryMode": "string",
"productType": "string",
"productScale": "string",
"lastTradingTimestamp": 0
}
]获取期货合约
签名
async getFutureContract(req: FutureContractSingleRequest): Promise<FutureContractInfo[]>用途
查询 future contract。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureContractSingleRequest | 是 | None | — |
req.contractCode | string | undefined | 否 | 无 | — |
req.type | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureContractInfo[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| continuous | boolean | 是否连续合约 |
| trade | boolean | 是否可交易 |
| type | string | 合约类型 |
| contractCode | string | 合约代码 |
| ibCode | string | IB 代码 |
| name | string | 名称 |
| contractMonth | string | 合约月份 |
| lastTradingDate | string | 最后交易日 |
| firstNoticeDate | string | 第一通知日 |
| lastBiddingCloseTime | number | 最后竞价截止时间 |
| currency | string | 币种 |
| exchangeCode | string | 交易所代码 |
| multiplier | number | 合约乘数 |
| minTick | number | 最小变动单位 |
| displayMultiplier | number | 显示乘数 |
| exchange | string | 交易所 |
| productWorth | string | 合约价值 |
| deliveryMode | string | 交割方式 |
| productType | string | 产品类型 |
| productScale | string | 产品精度 |
| lastTradingTimestamp | number | 最后交易时间戳 |
示例
const result = await quoteClient.getFutureContract({ contractCode: 'MEUR2609' });
console.log(result);返回示例
[
{
"continuous": "boolean",
"trade": "boolean",
"type": "string",
"contractCode": "string",
"ibCode": "string",
"name": "string",
"contractMonth": "string",
"lastTradingDate": "string",
"firstNoticeDate": "string",
"lastBiddingCloseTime": 0,
"currency": "string",
"exchangeCode": "string",
"multiplier": 0,
"minTick": 0,
"displayMultiplier": 0,
"exchange": "string",
"productWorth": "string",
"deliveryMode": "string",
"productType": "string",
"productScale": "string",
"lastTradingTimestamp": 0
}
]获取所有期货合约
签名
async getAllFutureContracts(req: AllFutureContractsRequest): Promise<FutureContractInfo[]>用途
查询 all future contracts。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | AllFutureContractsRequest | 是 | None | — |
req.type | string | undefined | 否 | 无 | — |
req.exchange | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureContractInfo[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| continuous | boolean | 是否连续合约 |
| trade | boolean | 是否可交易 |
| type | string | 合约类型 |
| contractCode | string | 合约代码 |
| ibCode | string | IB 代码 |
| name | string | 名称 |
| contractMonth | string | 合约月份 |
| lastTradingDate | string | 最后交易日 |
| firstNoticeDate | string | 第一通知日 |
| lastBiddingCloseTime | number | 最后竞价截止时间 |
| currency | string | 币种 |
| exchangeCode | string | 交易所代码 |
| multiplier | number | 合约乘数 |
| minTick | number | 最小变动单位 |
| displayMultiplier | number | 显示乘数 |
| exchange | string | 交易所 |
| productWorth | string | 合约价值 |
| deliveryMode | string | 交割方式 |
| productType | string | 产品类型 |
| productScale | string | 产品精度 |
| lastTradingTimestamp | number | 最后交易时间戳 |
示例
const result = await quoteClient.getAllFutureContracts({ type: 'MEUR' });
console.log(result);返回示例
[
{
"continuous": "boolean",
"trade": "boolean",
"type": "string",
"contractCode": "string",
"ibCode": "string",
"name": "string",
"contractMonth": "string",
"lastTradingDate": "string",
"firstNoticeDate": "string",
"lastBiddingCloseTime": 0,
"currency": "string",
"exchangeCode": "string",
"multiplier": 0,
"minTick": 0,
"displayMultiplier": 0,
"exchange": "string",
"productWorth": "string",
"deliveryMode": "string",
"productType": "string",
"productScale": "string",
"lastTradingTimestamp": 0
}
]获取当前合约
签名
async getCurrentFutureContract(req: FutureContractSingleRequest): Promise<FutureContractInfo | undefined>用途
查询 current future contract。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureContractSingleRequest | 是 | None | — |
req.contractCode | string | undefined | 否 | 无 | — |
req.type | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureContractInfo | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| continuous | boolean | 是否连续合约 |
| trade | boolean | 是否可交易 |
| type | string | 合约类型 |
| contractCode | string | 合约代码 |
| ibCode | string | IB 代码 |
| name | string | 名称 |
| contractMonth | string | 合约月份 |
| lastTradingDate | string | 最后交易日 |
| firstNoticeDate | string | 第一通知日 |
| lastBiddingCloseTime | number | 最后竞价截止时间 |
| currency | string | 币种 |
| exchangeCode | string | 交易所代码 |
| multiplier | number | 合约乘数 |
| minTick | number | 最小变动单位 |
| displayMultiplier | number | 显示乘数 |
| exchange | string | 交易所 |
| productWorth | string | 合约价值 |
| deliveryMode | string | 交割方式 |
| productType | string | 产品类型 |
| productScale | string | 产品精度 |
| lastTradingTimestamp | number | 最后交易时间戳 |
示例
const result = await quoteClient.getCurrentFutureContract({ type: 'MEUR' });
console.log(result);返回示例
{
"continuous": "boolean",
"trade": "boolean",
"type": "string",
"contractCode": "string",
"ibCode": "string",
"name": "string",
"contractMonth": "string",
"lastTradingDate": "string",
"firstNoticeDate": "string",
"lastBiddingCloseTime": 0,
"currency": "string",
"exchangeCode": "string",
"multiplier": 0,
"minTick": 0,
"displayMultiplier": 0,
"exchange": "string",
"productWorth": "string",
"deliveryMode": "string",
"productType": "string",
"productScale": "string",
"lastTradingTimestamp": 0
}获取连续合约
签名
async getFutureContinuousContracts(req: FutureContinuousContractsRequest): Promise<FutureContractInfo[]>用途
查询 future continuous contracts。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureContinuousContractsRequest | 是 | None | — |
req.type | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureContractInfo[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| continuous | boolean | 是否连续合约 |
| trade | boolean | 是否可交易 |
| type | string | 合约类型 |
| contractCode | string | 合约代码 |
| ibCode | string | IB 代码 |
| name | string | 名称 |
| contractMonth | string | 合约月份 |
| lastTradingDate | string | 最后交易日 |
| firstNoticeDate | string | 第一通知日 |
| lastBiddingCloseTime | number | 最后竞价截止时间 |
| currency | string | 币种 |
| exchangeCode | string | 交易所代码 |
| multiplier | number | 合约乘数 |
| minTick | number | 最小变动单位 |
| displayMultiplier | number | 显示乘数 |
| exchange | string | 交易所 |
| productWorth | string | 合约价值 |
| deliveryMode | string | 交割方式 |
| productType | string | 产品类型 |
| productScale | string | 产品精度 |
| lastTradingTimestamp | number | 最后交易时间戳 |
示例
const result = await quoteClient.getFutureContinuousContracts({ type: 'MEUR' });
console.log(result);返回示例
[
{
"continuous": "boolean",
"trade": "boolean",
"type": "string",
"contractCode": "string",
"ibCode": "string",
"name": "string",
"contractMonth": "string",
"lastTradingDate": "string",
"firstNoticeDate": "string",
"lastBiddingCloseTime": 0,
"currency": "string",
"exchangeCode": "string",
"multiplier": 0,
"minTick": 0,
"displayMultiplier": 0,
"exchange": "string",
"productWorth": "string",
"deliveryMode": "string",
"productType": "string",
"productScale": "string",
"lastTradingTimestamp": 0
}
]获取历史主力合约
签名
async getFutureHistoryMainContract(req: FutureHistoryMainContractRequest): Promise<FutureMainContractHistory[]>用途
查询 future history main contract。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureHistoryMainContractRequest | 是 | None | — |
req.contractCodes | string[] | undefined | 否 | 无 | — |
req.beginTime | number | undefined | 否 | 无 | — |
req.endTime | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureMainContractHistory[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| contractCode | string | 合约代码 |
| symbol | string | 股票代码 |
| beginDate | string | 开始日期 |
| endDate | string | 结束日期 |
示例
const result = await quoteClient.getFutureHistoryMainContract({ contractCodes: ['MEUR2609'], beginTime: Date.UTC(2026, 0, 1), endTime: Date.UTC(2026, 6, 31) });
console.log(result);返回示例
[
{
"contractCode": "string",
"symbol": "string",
"beginDate": "string",
"endDate": "string"
}
]获取期货实时行情
签名
async getFutureRealTimeQuote(req: FutureBriefRequest): Promise<FutureQuote[]>用途
查询 future real time quote。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureBriefRequest | 是 | None | — |
req.contractCodes | string[] | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureQuote[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| contractCode | string | 合约代码 |
| latestPrice | number | 最新价 |
| latestSize | number | 最新成交量 |
| latestTime | number | 最新成交时间(毫秒时间戳) |
| bidPrice | number | 买一价 |
| askPrice | number | 卖一价 |
| bidSize | number | 买一量 |
| askSize | number | 卖一量 |
| openInterest | number | 未平仓量 |
| openInterestChange | number | 未平仓量变动 |
| volume | number | 成交量 |
| open | number | 开盘价 |
| high | number | 最高价 |
| low | number | 最低价 |
| settlement | number | 结算价 |
| limitUp | number | 涨停价 |
| limitDown | number | 跌停价 |
| avgPrice | number | 均价 |
示例
const result = await quoteClient.getFutureRealTimeQuote({ contractCodes: ['MEUR2609'] });
console.log(result);返回示例
[
{
"contractCode": "string",
"latestPrice": 0,
"latestSize": 0,
"latestTime": 0,
"bidPrice": 0,
"askPrice": 0,
"bidSize": 0,
"askSize": 0,
"openInterest": 0,
"openInterestChange": 0,
"volume": 0,
"open": 0,
"high": 0,
"low": 0,
"settlement": 0,
"limitUp": 0,
"limitDown": 0,
"avgPrice": 0
}
]获取期货 K 线
签名
async getFutureKline(req: FutureKlineRequest): Promise<FutureKline[]>用途
查询 future kline。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureKlineRequest | 是 | None | — |
req.contractCodes | string[] | undefined | 否 | 无 | — |
req.contractCode | string | undefined | 否 | 无 | — |
req.period | string | undefined | 否 | 无 | — |
req.beginTime | number | undefined | 否 | -1 (client) | — |
req.endTime | number | undefined | 否 | -1 (client) | — |
req.beginIndex | number | undefined | 否 | 无 | — |
req.endIndex | number | undefined | 否 | 无 | — |
req.limit | number | undefined | 否 | 无 | — |
req.pageToken | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureKline[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| nextPageToken | string | 下一页 token |
| items | FutureKlineItem[] | 数据数组 |
示例
const result = await quoteClient.getFutureKline({ contractCodes: ['MEUR2609'], period: 'day', beginTime: -1, endTime: -1 });
console.log(result);返回示例
[
{
"nextPageToken": "string",
"items": [
"FutureKlineItem"
]
}
]分页获取期货 K 线
签名
async getFutureKlineByPage(req: FutureKlineByPageRequest): Promise<FutureKlineItem[]>用途
查询 future kline by page。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureKlineByPageRequest | 是 | None | — |
req.contractCode | string | undefined | 否 | 无 | — |
req.period | string | undefined | 否 | 无 | — |
req.beginTime | number | undefined | 否 | 无 | — |
req.endTime | number | undefined | 否 | 无 | — |
req.totalSize | number | undefined | 否 | 1000 (client) | — |
req.pageSize | number | undefined | 否 | 200 (client) | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureKlineItem[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| time | number | 时间(毫秒时间戳) |
| volume | number | 成交量 |
| open | number | 开盘价 |
| close | number | 收盘价 |
| high | number | 最高价 |
| low | number | 最低价 |
| lastTime | number | 最后时间 |
| openInterest | number | 未平仓量 |
| settlement | number | 结算价 |
示例
const result = await quoteClient.getFutureKlineByPage({ contractCode: 'MEUR2609', period: 'day', totalSize: 500, pageSize: 200 });
console.log(result);返回示例
[
{
"time": 0,
"volume": 0,
"open": 0,
"close": 0,
"high": 0,
"low": 0,
"lastTime": 0,
"openInterest": 0,
"settlement": 0
}
]获取期货逐笔
签名
async getFutureTradeTicks(req: FutureTradeTicksRequest): Promise<FutureTradeTickItem[]>用途
查询 future trade ticks。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureTradeTicksRequest | 是 | None | — |
req.contractCode | string | undefined | 否 | 无 | — |
req.beginIndex | number | undefined | 否 | 无 | — |
req.endIndex | number | undefined | 否 | 30 when falsy (client) | — |
req.limit | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureTradeTickItem[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| contractCode | string | 合约代码 |
| index | number | 索引 |
| time | number | 时间(毫秒时间戳) |
| price | number | 价格 |
| volume | number | 成交量 |
| direction | string | 方向 |
示例
const result = await quoteClient.getFutureTradeTicks({ contractCode: 'MEUR2609', limit: 10 });
console.log(result);返回示例
[
{
"contractCode": "string",
"index": 0,
"time": 0,
"price": 0,
"volume": 0,
"direction": "string"
}
]获取期货深度
签名
async getFutureDepth(req: FutureDepthRequest): Promise<FutureDepth[]>用途
查询 future depth。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureDepthRequest | 是 | None | — |
req.contractCodes | string[] | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureDepth[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| contractCode | string | 合约代码 |
| timestamp | number | 时间戳 |
| asks | DepthLevel[] | 卖方委托队列 |
| bids | DepthLevel[] | 买方委托队列 |
示例
const result = await quoteClient.getFutureDepth({ contractCodes: ['MEUR2609'] });
console.log(result);返回示例
[
{
"contractCode": "string",
"timestamp": 0,
"asks": [
"DepthLevel"
],
"bids": [
"DepthLevel"
]
}
]获取期货交易时间
签名
async getFutureTradingTimes(req: FutureTradingTimesRequest): Promise<FutureTradingTime | undefined>用途
查询 future trading times。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FutureTradingTimesRequest | 是 | None | — |
req.contractCode | string | undefined | 否 | 无 | — |
req.tradingDate | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FutureTradingTime | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| contractCode | string | 合约代码 |
| bizDate | string | 业务日期 |
| zone | string | 时区 |
| tradingTimes | FutureTradingSegment[] | 交易时段列表 |
示例
const result = await quoteClient.getFutureTradingTimes({ contractCode: 'MEUR2609', tradingDate: '2026-07-24' });
console.log(result);返回示例
{
"contractCode": "string",
"bizDate": "string",
"zone": "string",
"tradingTimes": [
{
"start": 0,
"end": 0,
"type": "string"
}
]
}Updated 8 days ago
