Option Exercise

Option Exercise Check

Purpose

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 fieldTypeRequiredSerializationSDK default and constraints
TypestringYesOmitted if emptyExercise or Expire
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US
AccountstringNoUses the client default account when emptyTrading account; the client default is used when empty
SecretKeystringNoUses client configuration when availableInstitutional-account secret key; populated from client configuration when available
ContractIdint64YesOmitted when zeroContract ID
Quantityfloat64YesOmitted when zeroExercise or expiry quantity
ExecutingDatestringNoOmitted when emptyExecution date in yyyy-MM-dd format
IsForce*boolNoOmitted when nilWhether to force execution
ItmRate*intNoOmitted when nilIn-the-money rate from 0 to 10

Returns

(*model.OptionExerciseCheckResult, error). Key fields from model.OptionExerciseCheckResult:

FieldTypeDescription
AvailableQuantityfloat64Available quantity for exercise
Positionfloat64Option position quantity
StkPositionfloat64Underlying stock position
StkPositionChangefloat64Stock position change
StkPositionBeforefloat64Stock position before exercise
StkPositionAfterfloat64Stock position after exercise
SymbolstringSymbol 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,
  "stkPositionChange": 100,
  "stkPositionBefore": 0,
  "stkPositionAfter": 100,
  "symbol": "AAPL"
}

Rate limit

The base rate limit is 60 requests/min.


Option Exercise Positions

Purpose

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 fieldTypeRequiredSerializationSDK default and constraints
TypestringYesOmitted if emptyExercise or Expire
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US
AccountstringNoUses the client default account when emptyTrading account; the client default is used when empty
SecretKeystringNoUses client configuration when availableInstitutional-account secret key; populated from client configuration when available

Returns

(*model.OptionExercisePositionPageResult, error). Key fields from model.OptionExercisePositionPageResult:

FieldTypeDescription
PageNumintCurrent page number
PageSizeintPage size
ItemCountintTotal item count
PageCountintTotal page count
Items[]OptionExercisePositionExercisable position list
OptionExercisePosition fieldTypeDescription
ContractIdint64Contract ID
SymbolstringOption symbol
StkSymbolstringUnderlying stock symbol
ExpireDatestringExpiry date
StrikestringStrike price
CallPutstringCall or put side
MarketstringMarket
AccountIdint64Numeric account ID
Positionfloat64Position quantity
AvailableQuantityfloat64Available quantity

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": [
    {
      "contractId": 55678,
      "symbol": "AAPL",
      "stkSymbol": "AAPL",
      "expireDate": "20250815",
      "strike": "300",
      "callPut": "CALL",
      "market": "US",
      "accountId": 123,
      "position": 10,
      "availableQuantity": 10
    }
  ]
}

Rate limit

The base rate limit is 60 requests/min.


Option Exercise Submit

Purpose

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 fieldTypeRequiredSerializationSDK default and constraints
TypestringYesOmitted if emptyExercise or Expire
ExecutingDatestringConditionalOmitted if emptyNone; Type=Exercise requires this field; yyyy-MM-dd
IsForce*boolConditionalOmitted if emptyNone; Type=Exercise requires this field
ItmRate*intConditionalOmitted if emptyRequired for Expire; range 0–10
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US
AccountstringNoUses the client default account when emptyTrading account; the client default is used when empty
SecretKeystringNoUses client configuration when availableInstitutional-account secret key; populated from client configuration when available
ContractIdint64YesOmitted when zeroContract ID
Quantityfloat64YesOmitted when zeroExercise or expiry quantity

Returns

(bool, error); true means the server accepted the operation.

Invocation example

isForce := false
result, err := tc.OptionExerciseSubmit(model.OptionExerciseSubmitRequest{
	Account: "U123456",
	ContractId: 123456,
	Type: "Exercise",
	Quantity: 1,
	ExecutingDate: "2025-06-20",
	IsForce: &isForce,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
true

Rate limit

The base rate limit is 60 requests/min.


Option Exercise Records

Purpose

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 fieldTypeRequiredSerializationSDK default and constraints
PageintNoOmitted if emptyNone; Starts at 1; server default 1
SizeintNoOmitted if emptyNone; 1-100; server default 20
StatusstringNoOmitted if emptyNone; New
TypestringNoOmitted if emptyExercise or Expire
OrderBystringNoOmitted if emptyNone; symbol
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US
AccountstringNoUses the client default account when emptyTrading account; the client default is used when empty
SecretKeystringNoUses client configuration when availableInstitutional-account secret key; populated from client configuration when available
SymbolstringNoOmitted when emptySymbol

Returns

(*model.OptionExerciseRecordPageResult, error). Key fields from model.OptionExerciseRecordPageResult:

FieldTypeDescription
PageNumintCurrent page number
PageSizeintPage size
ItemCountintTotal item count
PageCountintTotal page count
Items[]OptionExerciseRecordExercise record list
OptionExerciseRecord fieldTypeDescription
Idint64Record ID
ContractIdint64Contract ID
SymbolstringOption symbol
StkSymbolstringUnderlying stock symbol
ExpireDatestringExpiry date
StrikestringStrike price
CallPutstringCall or put side
TypestringRequest type
RequestQuantityfloat64Requested quantity
Quantityfloat64Executed quantity
StatusstringStatus
ExecutingDatestringExecution date
ItmRateintIn-the-money rate
IsForceboolWhether execution is forced
ReasonstringReason
AccountIdint64Numeric account ID

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,
      "contractId": 55678,
      "symbol": "AAPL",
      "stkSymbol": "AAPL",
      "expireDate": "20250815",
      "strike": "300",
      "callPut": "CALL",
      "type": "Exercise",
      "requestQuantity": 5,
      "quantity": 5,
      "status": "New",
      "executingDate": "2025-08-15",
      "itmRate": 0,
      "isForce": false,
      "reason": "",
      "accountId": 123
    }
  ]
}

Rate limit

The base rate limit is 60 requests/min.


Option Exercise Cancel

Purpose

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 fieldTypeRequiredSerializationSDK default and constraints
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US
AccountstringNoUses the client default account when emptyTrading account; the client default is used when empty
SecretKeystringNoUses client configuration when availableInstitutional-account secret key; populated from client configuration when available
Idint64YesOmitted when zeroExercise-request record ID

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)
true

Rate limit

The base rate limit is 60 requests/min.



Did this page help you?