Order Queries
Orders
Purpose
Lists orders using account, instrument, status, time, and pagination filters. The client unwraps the server items envelope, and fills an empty account field from the client default.
Signature
func (c *TradeClient) Orders(req model.OrdersRequest) ([]model.Order, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OrdersRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Account | string | No | Uses the client default when empty | Trading account ID |
SecretKey | string | No | Uses client configuration when both Account and SecretKey are empty; otherwise omitted when empty | Institutional-account authentication key |
Market | string | No | Omitted if empty | Allowed values: ALL, US, HK, CN, SG |
SecType | string | No | Omitted if empty | Allowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND |
SegType | string | No | Omitted if empty | Allowed values: ALL, SEC, FUT, FUND |
Symbol | string | No | Omitted if empty | Instrument symbol |
IsBrief | bool | No | Omitted when false | Whether to return brief order data |
StartDate | int64 | No | Omitted when zero | Start of the query range as a millisecond timestamp |
EndDate | int64 | No | Omitted when zero | End of the query range as a millisecond timestamp |
Limit | int | No | Omitted when zero | Result count; server default 100, maximum 300 |
States | []string | No | Omitted if empty | Order-status values |
ParentId | int64 | No | Omitted when zero | Parent order ID |
SortBy | string | No | Omitted if empty | Allowed values: LATEST_CREATED, LATEST_STATUS_UPDATED |
ShowCharges | *bool | No | Omitted when nil | Whether to request charge details; a pointer distinguishes explicit false from omission |
PageToken | string | No | Omitted if empty | Pagination cursor |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Time range: StartDate and EndDate are optional; omitting either bound applies no corresponding time filter. The interface defines no maximum time span, but per-response result limits still apply. Use a reasonable time range.
Returns
([]model.Order, error). Key fields from model.Order:
| Field | Type | Description |
|---|---|---|
| Account | string | Account ID |
| ID | int64 | Order ID |
| OrderId | int64 | Order number |
| Action | string | Trade direction (BUY/SELL) |
| OrderType | string | Order type |
| TotalQuantity | int64 | Order quantity |
| LimitPrice | float64 | Limit price |
| AuxPrice | float64 | Auxiliary price (stop price) |
| TrailingPercent | float64 | Trailing stop percentage |
| Status | string | Order status |
| FilledQuantity | int64 | Filled quantity |
| AvgFillPrice | float64 | Volume-weighted average of fill prices, excluding commissions and other fees |
| TimeInForce | string | Time in force |
| OutsideRth | bool | Outside regular trading hours |
| OrderLegs | []OrderLeg | Attached orders |
| AlgoParams | *AlgoParams | Algorithm parameters |
| Symbol | string | Instrument symbol |
| SecType | string | Security type |
| Market | string | Market |
| Currency | string | Currency |
| Expiry | string | Expiry date |
| Strike | string | Strike price |
| Right | string | Option side |
| Identifier | string | Contract identifier |
| Name | string | Contract name |
| Commission | float64 | Commission |
| RealizedPnl | float64 | Realized P&L |
| OpenTime | int64 | Open time in milliseconds |
| UpdateTime | int64 | Update time in milliseconds |
| LatestTime | int64 | Latest time in milliseconds |
| Remark | string | Remark |
| Source | string | Order source |
| UserMark | string | User mark |
| ExternalId | string | External ID |
| TotalQuantityScale | int | Order quantity scale |
| FilledQuantityScale | int | Filled quantity scale |
| FilledCashAmount | float64 | Filled cash amount |
| Gst | float64 | GST |
| Liquidation | bool | Whether this is a liquidation order |
| AttrDesc | string | Attribute description |
| AttrList | []string | Attribute list |
| AlgoStrategy | string | Algorithm strategy |
| Discount | float64 | Discount |
| ReplaceStatus | string | Replacement status |
| CancelStatus | string | Cancellation status |
| CanModify | bool | Whether the order can be modified |
| CanCancel | bool | Whether the order can be cancelled |
| IsOpen | bool | Whether the order is open |
| OrderDiscount | float64 | Order discount |
| TradingSessionType | string | Trading session type |
| LatestPrice | float64 | Latest price |
| DisplaySize | int64 | Iceberg display size |
| MinDisplaySize | int64 | Iceberg minimum display size |
| CheckIntervals | int64 | Iceberg price-check interval in seconds |
| PriceType | string | Iceberg price type |
| StartTime | int64 | Effective start time in milliseconds |
| EndTime | int64 | Effective end time in milliseconds |
OrderLeg field | Type | Description |
|---|---|---|
| LegType | string | Attached-order type |
| Price | float64 | Price |
| TimeInForce | string | Time in force |
| Quantity | int64 | Quantity |
AlgoParams field | Type | Description |
|---|---|---|
| AlgoStrategy | string | Algorithm strategy |
| StartTime | string | Start time |
| EndTime | string | End time |
| ParticipationRate | float64 | Participation rate |
Commission and GST are returned separately. Refer to the account statement for the exact calculation basis and currency. Go numeric fields are non-pointer values, so a missing value and an explicit zero both appear as 0.
Invocation example
result, err := tc.Orders(model.OrdersRequest{
Account: "U123456",
Market: "US",
SecType: "STK",
Symbol: "AAPL",
StartDate: 1,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"id": 123456789,
"orderId": 123456789,
"symbol": "AAPL",
"secType": "STK",
"market": "US",
"action": "BUY",
"orderType": "LMT",
"limitPrice": 310.00,
"totalQuantity": 100,
"filledQuantity": 100,
"avgFillPrice": 309.85,
"status": "Filled",
"account": "12345678",
"currency": "USD",
"openTime": 1785504600000,
"updateTime": 1785505200000
}
]Rate limit
The base rate limit is 120 requests/min. Orders and GetOrder both use orders and share this quota.
Get Order
Purpose
Retrieves one order by global ID or account-level order ID. The client fills an empty account field from the client default.
Signature
func (c *TradeClient) GetOrder(req model.GetOrderRequest) (*model.Order, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.GetOrderRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Account | string | No | Uses the client default when empty | Trading account ID |
SecretKey | string | No | Uses client configuration when both Account and SecretKey are empty; otherwise omitted when empty | Institutional-account authentication key |
Id | int64 | Conditionally | Omitted when zero | Global order ID; provide Id or OrderId |
OrderId | int64 | Conditionally | Omitted when zero | Account-level order ID; provide Id or OrderId |
IsBrief | bool | No | Omitted when false | Whether to return brief order data |
ShowCharges | *bool | No | Omitted when nil | Whether to request charge details; a pointer distinguishes explicit false from omission |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
(*model.Order, error). Key fields from model.Order:
| Field | Type | Description |
|---|---|---|
| Account | string | Account ID |
| ID | int64 | Order ID |
| OrderId | int64 | Order number |
| Action | string | Trade direction (BUY/SELL) |
| OrderType | string | Order type |
| TotalQuantity | int64 | Order quantity |
| LimitPrice | float64 | Limit price |
| AuxPrice | float64 | Auxiliary price (stop price) |
| TrailingPercent | float64 | Trailing stop percentage |
| Status | string | Order status |
| FilledQuantity | int64 | Filled quantity |
| AvgFillPrice | float64 | Average fill price |
| TimeInForce | string | Time in force |
| OutsideRth | bool | Outside regular trading hours |
| OrderLegs | []OrderLeg | Attached orders |
| AlgoParams | *AlgoParams | Algorithm parameters |
| Symbol | string | Instrument symbol |
| SecType | string | Security type |
| Market | string | Market |
| Currency | string | Currency |
| Expiry | string | Expiry date |
| Strike | string | Strike price |
| Right | string | Option side |
| Identifier | string | Contract identifier |
| Name | string | Contract name |
| Commission | float64 | Commission |
| RealizedPnl | float64 | Realized P&L |
| OpenTime | int64 | Open time in milliseconds |
| UpdateTime | int64 | Update time in milliseconds |
| LatestTime | int64 | Latest time in milliseconds |
| Remark | string | Remark |
| Source | string | Order source |
| UserMark | string | User mark |
| ExternalId | string | External ID |
| TotalQuantityScale | int | Order quantity scale |
| FilledQuantityScale | int | Filled quantity scale |
| FilledCashAmount | float64 | Filled cash amount |
| Gst | float64 | GST |
| Liquidation | bool | Whether this is a liquidation order |
| AttrDesc | string | Attribute description |
| AttrList | []string | Attribute list |
| AlgoStrategy | string | Algorithm strategy |
| Discount | float64 | Discount |
| ReplaceStatus | string | Replacement status |
| CancelStatus | string | Cancellation status |
| CanModify | bool | Whether the order can be modified |
| CanCancel | bool | Whether the order can be cancelled |
| IsOpen | bool | Whether the order is open |
| OrderDiscount | float64 | Order discount |
| TradingSessionType | string | Trading session type |
| LatestPrice | float64 | Latest price |
| DisplaySize | int64 | Iceberg display size |
| MinDisplaySize | int64 | Iceberg minimum display size |
| CheckIntervals | int64 | Iceberg price-check interval in seconds |
| PriceType | string | Iceberg price type |
| StartTime | int64 | Effective start time in milliseconds |
| EndTime | int64 | Effective end time in milliseconds |
OrderLeg fields
| Field | Type | Description |
|---|---|---|
LegType | string | Attached-order type |
Price | float64 | Price |
TimeInForce | string | Time in force |
Quantity | int64 | Quantity |
AlgoParams fields
| Field | Type | Description |
|---|---|---|
AlgoStrategy | string | Algorithm strategy |
StartTime | string | Algorithm-order start time |
EndTime | string | Algorithm-order end time |
ParticipationRate | float64 | Participation rate |
Invocation example
result, err := tc.GetOrder(model.GetOrderRequest{
Account: "U123456",
Id: 123456789,
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result){
"id": 123456789,
"orderId": 123456789,
"symbol": "AAPL",
"secType": "STK",
"market": "US",
"action": "BUY",
"orderType": "LMT",
"limitPrice": 310.00,
"totalQuantity": 100,
"filledQuantity": 100,
"avgFillPrice": 309.85,
"status": "Filled",
"account": "12345678",
"currency": "USD",
"openTime": 1785504600000,
"updateTime": 1785505200000
}Rate limit
The base rate limit is 120 requests/min. Orders and GetOrder both use orders and share this quota.
Active Orders
Purpose
Lists open orders and optionally filters attached orders by parent ID. The client unwraps the server items envelope, and fills an empty account field from the client default.
Signature
func (c *TradeClient) ActiveOrders(req model.OrdersRequest) ([]model.Order, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OrdersRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Account | string | No | Uses the client default when empty | Trading account ID |
SecretKey | string | No | Uses client configuration when both Account and SecretKey are empty; otherwise omitted when empty | Institutional-account authentication key |
Symbol | string | No | Omitted if empty | Instrument symbol |
Market | string | No | Omitted if empty | Allowed values: ALL, US, HK, CN, SG |
SecType | string | No | Omitted if empty | Allowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND |
SegType | string | No | Omitted if empty | Allowed values: ALL, SEC, FUT, FUND |
StartDate | int64 | No | Omitted when zero | Start of the query range as a millisecond timestamp |
EndDate | int64 | No | Omitted when zero | End of the query range as a millisecond timestamp |
States | []string | No | Omitted if empty | Order-status values |
SortBy | string | No | Omitted if empty | Allowed values: LATEST_CREATED, LATEST_STATUS_UPDATED |
ShowCharges | *bool | No | Omitted when nil | Whether to request charge details; a pointer distinguishes explicit false from omission |
IsBrief | bool | No | Omitted when false | Whether to return brief order data |
Limit | int | No | Omitted when zero | Result count; server default 100, maximum 300 |
ParentId | int64 | No | Omitted when zero | Parent order ID; filters attached orders |
PageToken | string | No | Omitted if empty | Pagination cursor |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
([]model.Order, error). Key fields from model.Order:
| Field | Type | Description |
|---|---|---|
| Account | string | Account ID |
| ID | int64 | Order ID |
| OrderId | int64 | Order number |
| Action | string | Trade direction (BUY/SELL) |
| OrderType | string | Order type |
| TotalQuantity | int64 | Order quantity |
| LimitPrice | float64 | Limit price |
| AuxPrice | float64 | Auxiliary price (stop price) |
| TrailingPercent | float64 | Trailing stop percentage |
| Status | string | Order status |
| FilledQuantity | int64 | Filled quantity |
| AvgFillPrice | float64 | Average fill price |
| TimeInForce | string | Time in force |
| OutsideRth | bool | Outside regular trading hours |
| OrderLegs | []OrderLeg | Attached orders |
| AlgoParams | *AlgoParams | Algorithm parameters |
| Symbol | string | Instrument symbol |
| SecType | string | Security type |
| Market | string | Market |
| Currency | string | Currency |
| Expiry | string | Expiry date |
| Strike | string | Strike price |
| Right | string | Option side |
| Identifier | string | Contract identifier |
| Name | string | Contract name |
| Commission | float64 | Commission |
| RealizedPnl | float64 | Realized P&L |
| OpenTime | int64 | Open time in milliseconds |
| UpdateTime | int64 | Update time in milliseconds |
| LatestTime | int64 | Latest time in milliseconds |
| Remark | string | Remark |
| Source | string | Order source |
| UserMark | string | User mark |
| ExternalId | string | External ID |
| TotalQuantityScale | int | Order quantity scale |
| FilledQuantityScale | int | Filled quantity scale |
| FilledCashAmount | float64 | Filled cash amount |
| Gst | float64 | GST |
| Liquidation | bool | Whether this is a liquidation order |
| AttrDesc | string | Attribute description |
| AttrList | []string | Attribute list |
| AlgoStrategy | string | Algorithm strategy |
| Discount | float64 | Discount |
| ReplaceStatus | string | Replacement status |
| CancelStatus | string | Cancellation status |
| CanModify | bool | Whether the order can be modified |
| CanCancel | bool | Whether the order can be cancelled |
| IsOpen | bool | Whether the order is open |
| OrderDiscount | float64 | Order discount |
| TradingSessionType | string | Trading session type |
| LatestPrice | float64 | Latest price |
| DisplaySize | int64 | Iceberg display size |
| MinDisplaySize | int64 | Iceberg minimum display size |
| CheckIntervals | int64 | Iceberg price-check interval in seconds |
| PriceType | string | Iceberg price type |
| StartTime | int64 | Effective start time in milliseconds |
| EndTime | int64 | Effective end time in milliseconds |
OrderLeg fields
| Field | Type | Description |
|---|---|---|
LegType | string | Attached-order type |
Price | float64 | Price |
TimeInForce | string | Time in force |
Quantity | int64 | Quantity |
AlgoParams fields
| Field | Type | Description |
|---|---|---|
AlgoStrategy | string | Algorithm strategy |
StartTime | string | Algorithm-order start time |
EndTime | string | Algorithm-order end time |
ParticipationRate | float64 | Participation rate |
Invocation example
result, err := tc.ActiveOrders(model.OrdersRequest{
Account: "U123456",
Market: "US",
SecType: "STK",
Symbol: "AAPL",
StartDate: 1,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"id": 123456790,
"orderId": 123456790,
"symbol": "TSLA",
"secType": "STK",
"market": "US",
"action": "BUY",
"orderType": "LMT",
"limitPrice": 280.00,
"totalQuantity": 50,
"filledQuantity": 0,
"status": "Submitted",
"account": "12345678",
"currency": "USD",
"openTime": 1785504600000
}
]Rate limit
The base rate limit is 120 requests/min.
Inactive Orders
Purpose
Lists inactive or cancelled orders using OrdersRequest filters. The client unwraps the server items envelope, and fills an empty account field from the client default.
Signature
func (c *TradeClient) InactiveOrders(req model.OrdersRequest) ([]model.Order, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OrdersRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Account | string | No | Uses the client default when empty | Trading account ID |
SecretKey | string | No | Uses client configuration when both Account and SecretKey are empty; otherwise omitted when empty | Institutional-account authentication key |
Symbol | string | No | Omitted if empty | Instrument symbol |
Market | string | No | Omitted if empty | Allowed values: ALL, US, HK, CN, SG |
SecType | string | No | Omitted if empty | Allowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND |
SegType | string | No | Omitted if empty | Allowed values: ALL, SEC, FUT, FUND |
StartDate | int64 | No | Omitted when zero | Start of the query range as a millisecond timestamp |
EndDate | int64 | No | Omitted when zero | End of the query range as a millisecond timestamp |
States | []string | No | Omitted if empty | Order-status values |
SortBy | string | No | Omitted if empty | Allowed values: LATEST_CREATED, LATEST_STATUS_UPDATED |
ShowCharges | *bool | No | Omitted when nil | Whether to request charge details; a pointer distinguishes explicit false from omission |
IsBrief | bool | No | Omitted when false | Whether to return brief order data |
Limit | int | No | Omitted when zero | Result count; server default 100, maximum 300 |
ParentId | int64 | No | Omitted when zero | Parent order ID |
PageToken | string | No | Omitted if empty | Pagination cursor |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
([]model.Order, error). Key fields from model.Order:
| Field | Type | Description |
|---|---|---|
| Account | string | Account ID |
| ID | int64 | Order ID |
| OrderId | int64 | Order number |
| Action | string | Trade direction (BUY/SELL) |
| OrderType | string | Order type |
| TotalQuantity | int64 | Order quantity |
| LimitPrice | float64 | Limit price |
| AuxPrice | float64 | Auxiliary price (stop price) |
| TrailingPercent | float64 | Trailing stop percentage |
| Status | string | Order status |
| FilledQuantity | int64 | Filled quantity |
| AvgFillPrice | float64 | Average fill price |
| TimeInForce | string | Time in force |
| OutsideRth | bool | Outside regular trading hours |
| OrderLegs | []OrderLeg | Attached orders |
| AlgoParams | *AlgoParams | Algorithm parameters |
| Symbol | string | Instrument symbol |
| SecType | string | Security type |
| Market | string | Market |
| Currency | string | Currency |
| Expiry | string | Expiry date |
| Strike | string | Strike price |
| Right | string | Option side |
| Identifier | string | Contract identifier |
| Name | string | Contract name |
| Commission | float64 | Commission |
| RealizedPnl | float64 | Realized P&L |
| OpenTime | int64 | Open time in milliseconds |
| UpdateTime | int64 | Update time in milliseconds |
| LatestTime | int64 | Latest time in milliseconds |
| Remark | string | Remark |
| Source | string | Order source |
| UserMark | string | User mark |
| ExternalId | string | External ID |
| TotalQuantityScale | int | Order quantity scale |
| FilledQuantityScale | int | Filled quantity scale |
| FilledCashAmount | float64 | Filled cash amount |
| Gst | float64 | GST |
| Liquidation | bool | Whether this is a liquidation order |
| AttrDesc | string | Attribute description |
| AttrList | []string | Attribute list |
| AlgoStrategy | string | Algorithm strategy |
| Discount | float64 | Discount |
| ReplaceStatus | string | Replacement status |
| CancelStatus | string | Cancellation status |
| CanModify | bool | Whether the order can be modified |
| CanCancel | bool | Whether the order can be cancelled |
| IsOpen | bool | Whether the order is open |
| OrderDiscount | float64 | Order discount |
| TradingSessionType | string | Trading session type |
| LatestPrice | float64 | Latest price |
| DisplaySize | int64 | Iceberg display size |
| MinDisplaySize | int64 | Iceberg minimum display size |
| CheckIntervals | int64 | Iceberg price-check interval in seconds |
| PriceType | string | Iceberg price type |
| StartTime | int64 | Effective start time in milliseconds |
| EndTime | int64 | Effective end time in milliseconds |
OrderLeg fields
| Field | Type | Description |
|---|---|---|
LegType | string | Attached-order type |
Price | float64 | Price |
TimeInForce | string | Time in force |
Quantity | int64 | Quantity |
AlgoParams fields
| Field | Type | Description |
|---|---|---|
AlgoStrategy | string | Algorithm strategy |
StartTime | string | Algorithm-order start time |
EndTime | string | Algorithm-order end time |
ParticipationRate | float64 | Participation rate |
Invocation example
result, err := tc.InactiveOrders(model.OrdersRequest{
Account: "U123456",
Market: "US",
SecType: "STK",
Symbol: "AAPL",
StartDate: 1,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"id": 123456789,
"orderId": 123456789,
"symbol": "AAPL",
"secType": "STK",
"market": "US",
"action": "BUY",
"orderType": "LMT",
"limitPrice": 310.00,
"totalQuantity": 100,
"filledQuantity": 100,
"avgFillPrice": 309.85,
"status": "Filled",
"account": "12345678",
"currency": "USD",
"openTime": 1785504600000,
"updateTime": 1785505200000
}
]Rate limit
The base rate limit is 120 requests/min.
Filled Orders
Purpose
Lists filled orders using OrdersRequest filters. The client unwraps the server items envelope, and fills an empty account field from the client default.
Signature
func (c *TradeClient) FilledOrders(req model.OrdersRequest) ([]model.Order, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OrdersRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Account | string | No | Uses the client default when empty | Trading account ID |
SecretKey | string | No | Uses client configuration when both Account and SecretKey are empty; otherwise omitted when empty | Institutional-account authentication key |
Symbol | string | No | Omitted if empty | Instrument symbol |
Market | string | No | Omitted if empty | Allowed values: ALL, US, HK, CN, SG |
SecType | string | No | Omitted if empty | Allowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND |
SegType | string | No | Omitted if empty | Allowed values: ALL, SEC, FUT, FUND |
StartDate | int64 | No | Omitted when zero | Start of the query range as a millisecond timestamp |
EndDate | int64 | No | Omitted when zero | End of the query range as a millisecond timestamp |
States | []string | No | Omitted if empty | Order-status values |
SortBy | string | No | Omitted if empty | Allowed values: LATEST_CREATED, LATEST_STATUS_UPDATED |
ShowCharges | *bool | No | Omitted when nil | Whether to request charge details; a pointer distinguishes explicit false from omission |
IsBrief | bool | No | Omitted when false | Whether to return brief order data |
Limit | int | No | Omitted when zero | Result count; server default 100, maximum 300 |
ParentId | int64 | No | Omitted when zero | Parent order ID |
PageToken | string | No | Omitted if empty | Pagination cursor |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
([]model.Order, error). Key fields from model.Order:
| Field | Type | Description |
|---|---|---|
| Account | string | Account ID |
| ID | int64 | Order ID |
| OrderId | int64 | Order number |
| Action | string | Trade direction (BUY/SELL) |
| OrderType | string | Order type |
| TotalQuantity | int64 | Order quantity |
| LimitPrice | float64 | Limit price |
| AuxPrice | float64 | Auxiliary price (stop price) |
| TrailingPercent | float64 | Trailing stop percentage |
| Status | string | Order status |
| FilledQuantity | int64 | Filled quantity |
| AvgFillPrice | float64 | Average fill price |
| TimeInForce | string | Time in force |
| OutsideRth | bool | Outside regular trading hours |
| OrderLegs | []OrderLeg | Attached orders; fields are listed in the Orders return table on this page |
| AlgoParams | *AlgoParams | Algorithm parameters; fields are listed in the Orders return table on this page |
| Symbol | string | Instrument symbol |
| SecType | string | Security type |
| Market | string | Market |
| Currency | string | Currency |
| Expiry | string | Expiry date |
| Strike | string | Strike price |
| Right | string | Option side |
| Identifier | string | Contract identifier |
| Name | string | Contract name |
| Commission | float64 | Commission |
| RealizedPnl | float64 | Realized P&L |
| OpenTime | int64 | Open time in milliseconds |
| UpdateTime | int64 | Update time in milliseconds |
| LatestTime | int64 | Latest time in milliseconds |
| Remark | string | Remark |
| Source | string | Order source |
| UserMark | string | User mark |
| ExternalId | string | External ID |
| TotalQuantityScale | int | Order quantity scale |
| FilledQuantityScale | int | Filled quantity scale |
| FilledCashAmount | float64 | Filled cash amount |
| Gst | float64 | GST |
| Liquidation | bool | Whether this is a liquidation order |
| AttrDesc | string | Attribute description |
| AttrList | []string | Attribute list |
| AlgoStrategy | string | Algorithm strategy |
| Discount | float64 | Discount |
| ReplaceStatus | string | Replacement status |
| CancelStatus | string | Cancellation status |
| CanModify | bool | Whether the order can be modified |
| CanCancel | bool | Whether the order can be cancelled |
| IsOpen | bool | Whether the order is open |
| OrderDiscount | float64 | Order discount |
| TradingSessionType | string | Trading session type |
| LatestPrice | float64 | Latest price |
| DisplaySize | int64 | Iceberg display size |
| MinDisplaySize | int64 | Iceberg minimum display size |
| CheckIntervals | int64 | Iceberg price-check interval in seconds |
| PriceType | string | Iceberg price type |
| StartTime | int64 | Effective start time in milliseconds |
| EndTime | int64 | Effective end time in milliseconds |
OrderLeg fields
| Field | Type | Description |
|---|---|---|
LegType | string | Attached-order type |
Price | float64 | Price |
TimeInForce | string | Time in force |
Quantity | int64 | Quantity |
AlgoParams fields
| Field | Type | Description |
|---|---|---|
AlgoStrategy | string | Algorithm strategy |
StartTime | string | Algorithm-order start time |
EndTime | string | Algorithm-order end time |
ParticipationRate | float64 | Participation rate |
Invocation example
result, err := tc.FilledOrders(model.OrdersRequest{
Account: "U123456",
Market: "US",
SecType: "STK",
Symbol: "AAPL",
StartDate: 1,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"id": 123456789,
"orderId": 123456789,
"symbol": "AAPL",
"secType": "STK",
"market": "US",
"action": "BUY",
"orderType": "LMT",
"limitPrice": 310.00,
"totalQuantity": 100,
"filledQuantity": 100,
"avgFillPrice": 309.85,
"status": "Filled",
"account": "12345678",
"currency": "USD",
"openTime": 1785504600000,
"updateTime": 1785505200000
}
]Rate limit
The base rate limit is 120 requests/min.
Order Transactions
Purpose
Lists execution records for orders or an instrument and time range. The client unwraps the server items envelope, and fills an empty account field from the client default.
Signature
func (c *TradeClient) OrderTransactions(req model.OrderTransactionsRequest) ([]model.Transaction, error)Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.
Parameters
model.OrderTransactionsRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Account | string | No | Uses the client default when empty | Trading account ID |
SecretKey | string | No | Uses client configuration when both Account and SecretKey are empty; otherwise omitted when empty | Institutional-account authentication key |
OrderId | int64 | No | Omitted when zero | Account-level order ID |
Symbol | string | No | Omitted if empty | Instrument symbol |
SecType | string | No | Omitted if empty | Allowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND |
StartDate | int64 | No | Omitted when zero | Start of the query range as a millisecond timestamp |
EndDate | int64 | No | Omitted when zero | End of the query range as a millisecond timestamp |
SinceDate | string | No | Omitted if empty | None; yyyyMMdd |
ToDate | string | No | Omitted if empty | End date in yyyyMMdd format |
Expiry | string | No | Omitted if empty | Expiry date |
Strike | float64 | No | Omitted when zero | Strike price |
Right | string | No | Omitted if empty | Allowed values: PUT, CALL (option side); br, nr when used as quote adjustment |
Limit | int | No | Omitted when zero | Result count |
PageToken | string | No | Omitted if empty | Pagination cursor |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
([]model.Transaction, error). Key fields from model.Transaction:
| Field | Type | Description |
|---|---|---|
| ID | int64 | Transaction record ID |
| OrderID | int64 | Order ID |
| AccountId | int64 | Account numeric ID |
| Account | string | Account ID |
| Symbol | string | Symbol code |
| SecType | string | Security type |
| Market | string | Market |
| Currency | string | Currency |
| Identifier | string | Identifier |
| Action | string | Trade direction (BUY/SELL) |
| Price | float64 | Order price |
| FilledPrice | float64 | Filled price |
| Quantity | int64 | Order quantity |
| FilledQuantity | int64 | Filled quantity |
| FilledQuantityScale | int | Filled quantity scale |
| Amount | float64 | Order amount |
| FilledAmount | float64 | Filled amount |
| Commission | float64 | Commission |
| TransactedAt | string | Transaction time in YYYY-MM-DD HH:MM:SS format |
| TransactionTime | int64 | Transaction time in milliseconds |
| Time | int64 | Compatibility time field |
The current API response may not populate Time.
Invocation example
result, err := tc.OrderTransactions(model.OrderTransactionsRequest{
Account: "U123456",
Symbol: "AAPL",
SecType: "STK",
StartDate: 1,
EndDate: 1,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"id": 987654321,
"orderId": 123456789,
"symbol": "AAPL",
"secType": "STK",
"action": "BUY",
"filledQuantity": 100,
"filledPrice": 309.85,
"filledAmount": 30985.00,
"transactionTime": 1785505200000,
"account": "12345678",
"currency": "USD"
}
]Rate limit
The base rate limit is 60 requests/min.
Updated about 7 hours ago
