期权行权
示例上下文
import { createClientConfig, TradeClient } from '@tigeropenapi/tigeropen';
const config = createClientConfig();
const tradeClient = TradeClient.fromConfig(config, config.account, config.secretKey);行权检查
签名
async checkOptionExercise(req: OptionExerciseCheckRequest): Promise<OptionExerciseCheckResult | undefined>用途
执行 check option exercise。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | OptionExerciseCheckRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.contractId | number | 是 | 无 | 期权合约 ID |
req.type | string | 是 | 无 | Exercise | Expire |
req.quantity | number | undefined | 否 | 无 | — |
req.executingDate | string | undefined | 否 | 无 | yyyy-MM-dd,Exercise 类型建议填 |
req.isForce | boolean | undefined | 否 | 无 | Exercise 类型建议填 |
req.itmRate | number | undefined | 否 | 无 | 0–10,Expire 类型专用 |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<OptionExerciseCheckResult | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| availableQuantity | number | 可行权数量 |
| position | number | 持仓数量 |
| stkPosition | number | 股票持仓 |
| stkPositionChange | number | 股票持仓变动 |
| stkPositionBefore | number | 行权前股票持仓 |
| stkPositionAfter | number | 行权后股票持仓 |
| symbol | string | 股票代码 |
示例
const result = await tradeClient.checkOptionExercise({ contractId: 123, type: 'Exercise' });
console.log(result);返回示例
{
"availableQuantity": 0,
"position": 0,
"stkPosition": 0,
"stkPositionChange": 0,
"stkPositionBefore": 0,
"stkPositionAfter": 0,
"symbol": "string"
}获取行权持仓
签名
async getOptionExercisePositions(req: OptionExercisePositionRequest): Promise<OptionExercisePositionPageResult | undefined>用途
查询可行权期权持仓。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | OptionExercisePositionRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.type | string | 是 | 无 | Exercise | Expire |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<OptionExercisePositionPageResult | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| pageNum | number | 页码 |
| pageSize | number | 每页大小 |
| itemCount | number | 条目数 |
| pageCount | number | 总页数 |
| items | OptionExercisePosition[] | 数据数组 |
示例
const result = await tradeClient.getOptionExercisePositions({ type: 'Exercise' });
console.log(result);返回示例
{
"pageNum": 0,
"pageSize": 0,
"itemCount": 0,
"pageCount": 0,
"items": [
{
"contractId": 0,
"symbol": "string",
"stkSymbol": "string",
"expireDate": "string",
"strike": "string",
"callPut": "string",
"market": "string",
"accountId": 0,
"position": 0,
"availableQuantity": 0
}
]
}提交行权
签名
async submitOptionExercise(req: OptionExerciseSubmitRequest): Promise<boolean>用途
执行 submit option exercise。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | OptionExerciseSubmitRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.contractId | number | 是 | 无 | — |
req.type | string | 是 | 无 | Exercise | Expire |
req.quantity | number | 是 | 无 | — |
req.executingDate | string | undefined | 否 | 无 | Exercise 必填,yyyy-MM-dd |
req.isForce | boolean | undefined | 否 | 无 | Exercise 必填 |
req.itmRate | number | undefined | 否 | 无 | 0–10,Expire 专用 |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<boolean>示例
const result = await tradeClient.submitOptionExercise({ contractId: 123, type: 'Exercise', quantity: 1 });
console.log(result);返回示例
"boolean"获取行权记录
签名
async getOptionExerciseRecords(req: OptionExerciseRecordsRequest): Promise<OptionExerciseRecordPageResult | undefined>用途
查询期权行权记录。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | OptionExerciseRecordsRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.page | number | undefined | 否 | 无 | 从 1 开始,默认 1 |
req.size | number | undefined | 否 | 无 | 1–100,默认 20 |
req.status | string | undefined | 否 | 无 | New | Cancel | Success | Fail |
req.type | string | undefined | 否 | 无 | Exercise | Expire |
req.symbol | string | undefined | 否 | 无 | — |
req.orderBy | string | undefined | 否 | 无 | symbol | expire_date | strike | is_call |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<OptionExerciseRecordPageResult | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| pageNum | number | 页码 |
| pageSize | number | 每页大小 |
| itemCount | number | 条目数 |
| pageCount | number | 总页数 |
| items | OptionExerciseRecord[] | 数据数组 |
示例
const result = await tradeClient.getOptionExerciseRecords({ page: 1, size: 20, type: 'Exercise' });
console.log(result);返回示例
{
"pageNum": 1,
"pageSize": 20,
"itemCount": 1,
"pageCount": 1,
"items": [
{
"id": 12345,
"contractId": 55678,
"symbol": "AAPL 260919C00200000",
"stkSymbol": "AAPL",
"expireDate": "20260919",
"strike": "200.0",
"callPut": "CALL",
"type": "Exercise",
"requestQuantity": 1,
"quantity": 1,
"status": "Submitted",
"executingDate": "2026-09-19",
"itmRate": 0,
"isForce": false,
"reason": "",
"accountId": 10001
}
]
}取消行权
签名
async cancelOptionExercise(req: OptionExerciseCancelRequest): Promise<boolean>用途
取消 option exercise。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | OptionExerciseCancelRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.id | number | 是 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<boolean>示例
const result = await tradeClient.cancelOptionExercise({ id: 1 });
console.log(result);返回示例
"boolean"Updated 9 days ago
Did this page help you?
