Option Exercise
OptionExerciseCheck
OptionExerciseCheckPurpose
Calculates the option and underlying-position impact of an exercise or expiry request. The client fills an empty account field from the client default.
Signature
func (c *TradeClient) OptionExerciseCheck(req model.OptionExerciseCheckRequest) (*model.OptionExerciseCheckResult, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OptionExerciseCheckRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Type | string | No | Omitted if empty | None; Exercise |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
(*model.OptionExerciseCheckResult, error). Key fields from model.OptionExerciseCheckResult:
| Field | Type | Description |
|---|---|---|
| AvailableQuantity | float64 | Available quantity for exercise |
| Position | float64 | Option position quantity |
| StkPosition | float64 | Underlying stock position |
| StkPositionChange | float64 | Stock position change |
| StkPositionBefore | float64 | Stock position before exercise |
| StkPositionAfter | float64 | Stock position after exercise |
| Symbol | string | Symbol code |
Invocation example
result, err := tc.OptionExerciseCheck(model.OptionExerciseCheckRequest{
Account: "U123456",
ContractId: 123456,
Type: "Exercise",
Quantity: 1,
ExecutingDate: "2025-06-20",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result){
"availableQuantity": 5,
"position": 10,
"stkPosition": 0,
"exerciseLimit": 10
}OptionExercisePositions
OptionExercisePositionsPurpose
Returns positions eligible for exercise or expiry handling. The client fills an empty account field from the client default.
Signature
func (c *TradeClient) OptionExercisePositions(req model.OptionExercisePositionRequest) (*model.OptionExercisePositionPageResult, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OptionExercisePositionRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Type | string | No | Omitted if empty | None; Exercise |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
(*model.OptionExercisePositionPageResult, error). Key fields from model.OptionExercisePositionPageResult:
| Field | Type | Description |
|---|---|---|
| PageNum | int | Current page number |
| PageSize | int | Page size |
| ItemCount | int | Total item count |
| PageCount | int | Total page count |
| Items | []OptionExercisePosition | Exercisable position list |
Invocation example
result, err := tc.OptionExercisePositions(model.OptionExercisePositionRequest{
Account: "U123456",
Type: "Exercise",
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result){
"pageNum": 1,
"pageSize": 20,
"itemCount": 1,
"pageCount": 1,
"items": [
{
"identifier": "AAPL 250815C00300000",
"symbol": "AAPL",
"expiry": "2025-08-15",
"strike": 300.0,
"right": "CALL",
"position": 10,
"exerciseQuantity": 0
}
]
}OptionExerciseSubmit
OptionExerciseSubmitPurpose
Submits an option exercise or expiry-handling request. The client fills an empty account field from the client default.
Signature
func (c *TradeClient) OptionExerciseSubmit(req model.OptionExerciseSubmitRequest) (bool, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OptionExerciseSubmitRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Type | string | No | Omitted if empty | None; Exercise |
ExecutingDate | string | Conditional | Omitted if empty | None; Type=Exercise requires this field; yyyy-MM-dd |
IsForce | *bool | Conditional | Omitted if empty | None; Type=Exercise requires this field |
ItmRate | *int | No | Omitted if empty | None; Type=Expire only; 0-10 |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
(bool, error); true means the server accepted the operation.
Invocation example
result, err := tc.OptionExerciseSubmit(model.OptionExerciseSubmitRequest{
Account: "U123456",
ContractId: 123456,
Type: "Exercise",
Quantity: 1,
ExecutingDate: "2025-06-20",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)trueOptionExerciseRecords
OptionExerciseRecordsPurpose
Returns a filtered, paginated list of option-exercise requests. The client fills an empty account field from the client default.
Signature
func (c *TradeClient) OptionExerciseRecords(req model.OptionExercisePageRequest) (*model.OptionExerciseRecordPageResult, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OptionExercisePageRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Page | int | No | Omitted if empty | None; Starts at 1; server default 1 |
Size | int | No | Omitted if empty | None; 1-100; server default 20 |
Status | string | No | Omitted if empty | None; New |
Type | string | No | Omitted if empty | None; Exercise |
OrderBy | string | No | Omitted if empty | None; symbol |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
(*model.OptionExerciseRecordPageResult, error). Key fields from model.OptionExerciseRecordPageResult:
| Field | Type | Description |
|---|---|---|
| PageNum | int | Current page number |
| PageSize | int | Page size |
| ItemCount | int | Total item count |
| PageCount | int | Total page count |
| Items | []OptionExerciseRecord | Exercise record list |
Invocation example
result, err := tc.OptionExerciseRecords(model.OptionExercisePageRequest{
Account: "U123456",
Page: 1,
Size: 20,
Type: "Exercise",
Symbol: "AAPL",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result){
"pageNum": 1,
"pageSize": 20,
"itemCount": 1,
"pageCount": 1,
"items": [
{
"id": 998877,
"identifier": "AAPL 250815C00300000",
"symbol": "AAPL",
"expiry": "2025-08-15",
"strike": 300.0,
"right": "CALL",
"quantity": 5,
"status": "Submitted",
"createTime": 1785528000000
}
]
}OptionExerciseCancel
OptionExerciseCancelPurpose
Cancels a pending option-exercise request by record ID. The client fills an empty account field from the client default.
Signature
func (c *TradeClient) OptionExerciseCancel(req model.OptionExerciseCancelRequest) (bool, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OptionExerciseCancelRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
(bool, error); true means the server accepted the operation.
Invocation example
result, err := tc.OptionExerciseCancel(model.OptionExerciseCancelRequest{
Account: "U123456",
Id: 789012,
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)trueUpdated about 17 hours ago
