订单查询
状态变更操作必须防止重复提交。
TradeOrder 中的 AvgFillPrice 是按成交价格加权计算的平均成交价,不含佣金和其他费用。RealizedPnl 是已实现盈亏;Commission 和 Gst 通过独立字段返回。准确的计算口径和币种请以账户结单为准。Commission、Gst、AvgFillPrice 和 RealizedPnl 在此 SDK 中为非可空 Double,因此无法区分字段缺失和明确返回的 0。ReplaceStatus=REPLACED 表示改单最终成功,FAILED 表示失败;CancelStatus=RECEIVED 仅表示撤单请求受理,最终结果以订单 Status 为准。
获取订单号
操作名
TradeApiService.ORDER_NO = order_no。该常量用于设置 TigerRequest.ApiMethodName。
请求
TigerRequest<TigerDictResponse>ModelValue: TradeModel.
参数
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | CLR 默认值;序列化时省略 | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | 为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败 |
SecretKey | string | secret_key | null | no | — |
返回
TigerDictResponse inherits TigerResponse; its data property is 字典,键为 string,值为 object. Key SDK fields: 动态字段.
示例
TigerRequest<TigerDictResponse> request = new()
{
ApiMethodName = TradeApiService.ORDER_NO,
ModelValue = new TradeModel { Account = tradeClient.GetDefaultAccount }
};
TigerDictResponse? response = await tradeClient.ExecuteAsync(request);响应类型
Dictionary<string, object>? data = response?.Data; // response 或 data 缺失时为 null频率限制
基础额度:每分钟 120 次。
获取订单列表
操作名
TradeApiService.ORDERS = orders。该常量用于设置 TigerRequest.ApiMethodName。
请求
TigerRequest<OrderBatchResponse>ModelValue: QueryOrderModel.
参数
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | CLR 默认值;序列化时省略 | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | 为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败 |
SecretKey | string | secret_key | null | no | — |
Id | Int64 | id | CLR 默认值;序列化时省略 | Required | — |
IsShowCharges | Boolean | show_charges | CLR 默认值;序列化时省略 | Optional | — |
SegType | SegmentType | seg_type | CLR 默认值;序列化时省略 | Optional | — |
SecType | SecType | sec_type | CLR 默认值;序列化时省略 | Optional | — |
Market | Market | market | CLR 默认值;序列化时省略 | Optional | Enum value |
Symbol | string | symbol | null | Required | — |
Right | string (nullable) | right | null | Optional | — |
Strike | string (nullable) | strike | null | Optional | — |
Expiry | string (nullable) | expiry | null | Optional | — |
StartDate | Int64 | start_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
EndDate | Int64 | end_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
Limit | Int32 | limit | 100 | Optional | Positive integer |
SortBy | OrderSortBy | sort_by | CLR 默认值;序列化时省略 | Optional | — |
PageToken | string | page_token | null | Optional | — |
时间范围说明:StartDate 和 EndDate 均可选;省略任一边界时,该边界不参与筛选。接口不限制最大时间跨度,但分页和单次返回数量限制仍然适用。建议指定合理的起止时间范围。
返回
OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem. Key SDK fields: Items: list of TradeOrder.
示例
TigerRequest<OrderBatchResponse> request = new()
{
ApiMethodName = TradeApiService.ORDERS,
ModelValue = new QueryOrderModel { Account = tradeClient.GetDefaultAccount, Id = 1234567890L, SegType = SegmentType.SEC, SecType = SecType.STK, Market = Market.US }
};
OrderBatchResponse? response = await tradeClient.ExecuteAsync(request);响应类型
OrderBatchItem? data = response?.Data; // response 或 data 缺失时为 null返回示例
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": {
"items": [
{
"id": 123456,
"orderId": 789012,
"symbol": "AAPL",
"action": "BUY",
"orderType": "LMT",
"totalQuantity": 100,
"filledQuantity": 100,
"limitPrice": 150.0,
"avgFillPrice": 149.95,
"status": "Filled",
"openTime": 1785441600000,
"latestTime": 1785441650000
}
]
}
}频率限制
基础额度:每分钟 120 次。
获取待成交订单
操作名
TradeApiService.ACTIVE_ORDERS = active_orders。该常量用于设置 TigerRequest.ApiMethodName。
请求
TigerRequest<OrderBatchResponse>ModelValue: QueryOrderModel.
参数
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | CLR 默认值;序列化时省略 | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | 为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败 |
SecretKey | string | secret_key | null | no | — |
Id | Int64 | id | CLR 默认值;序列化时省略 | Required | — |
IsShowCharges | Boolean | show_charges | CLR 默认值;序列化时省略 | Optional | — |
SegType | SegmentType | seg_type | CLR 默认值;序列化时省略 | Optional | — |
SecType | SecType | sec_type | CLR 默认值;序列化时省略 | Optional | — |
Market | Market | market | CLR 默认值;序列化时省略 | Optional | Enum value |
Symbol | string | symbol | null | Required | — |
Right | string (nullable) | right | null | Optional | — |
Strike | string (nullable) | strike | null | Optional | — |
Expiry | string (nullable) | expiry | null | Optional | — |
StartDate | Int64 | start_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
EndDate | Int64 | end_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
Limit | Int32 | limit | 100 | Optional | Positive integer |
SortBy | OrderSortBy | sort_by | CLR 默认值;序列化时省略 | Optional | — |
PageToken | string | page_token | null | Optional | — |
返回
OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem. Key SDK fields: Items: list of TradeOrder.
示例
TigerRequest<OrderBatchResponse> request = new()
{
ApiMethodName = TradeApiService.ACTIVE_ORDERS,
ModelValue = new QueryOrderModel { Account = tradeClient.GetDefaultAccount, Id = 1234567890L, SegType = SegmentType.SEC, SecType = SecType.STK, Market = Market.US }
};
OrderBatchResponse? response = await tradeClient.ExecuteAsync(request);响应类型
OrderBatchItem? data = response?.Data; // response 或 data 缺失时为 null返回示例
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": {
"items": [
{
"id": 123457,
"orderId": 789013,
"symbol": "TSLA",
"action": "BUY",
"orderType": "LMT",
"totalQuantity": 50,
"filledQuantity": 0,
"limitPrice": 280.0,
"status": "PendingSubmit",
"openTime": 1785527000000
}
]
}
}频率限制
基础额度:每分钟 120 次。
获取已撤销订单
操作名
TradeApiService.INACTIVE_ORDERS = inactive_orders。该常量用于设置 TigerRequest.ApiMethodName。
请求
TigerRequest<OrderBatchResponse>ModelValue: QueryOrderModel.
参数
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | CLR 默认值;序列化时省略 | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | 为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败 |
SecretKey | string | secret_key | null | no | — |
Id | Int64 | id | CLR 默认值;序列化时省略 | Required | — |
IsShowCharges | Boolean | show_charges | CLR 默认值;序列化时省略 | Optional | — |
SegType | SegmentType | seg_type | CLR 默认值;序列化时省略 | Optional | — |
SecType | SecType | sec_type | CLR 默认值;序列化时省略 | Optional | — |
Market | Market | market | CLR 默认值;序列化时省略 | Optional | Enum value |
Symbol | string | symbol | null | Required | — |
Right | string (nullable) | right | null | Optional | — |
Strike | string (nullable) | strike | null | Optional | — |
Expiry | string (nullable) | expiry | null | Optional | — |
StartDate | Int64 | start_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
EndDate | Int64 | end_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
Limit | Int32 | limit | 100 | Optional | Positive integer |
SortBy | OrderSortBy | sort_by | CLR 默认值;序列化时省略 | Optional | — |
PageToken | string | page_token | null | Optional | — |
返回
OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem. Key SDK fields: Items: list of TradeOrder.
示例
TigerRequest<OrderBatchResponse> request = new()
{
ApiMethodName = TradeApiService.INACTIVE_ORDERS,
ModelValue = new QueryOrderModel { Account = tradeClient.GetDefaultAccount, Id = 1234567890L, SegType = SegmentType.SEC, SecType = SecType.STK, Market = Market.US }
};
OrderBatchResponse? response = await tradeClient.ExecuteAsync(request);响应类型
OrderBatchItem? data = response?.Data; // response 或 data 缺失时为 null返回示例
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": {
"items": [
{
"id": 123456,
"orderId": 789012,
"symbol": "AAPL",
"action": "BUY",
"orderType": "LMT",
"totalQuantity": 100,
"filledQuantity": 100,
"limitPrice": 150.0,
"avgFillPrice": 149.95,
"status": "Filled"
}
]
}
}频率限制
基础额度:每分钟 120 次。
获取已成交订单
操作名
TradeApiService.FILLED_ORDERS = filled_orders。该常量用于设置 TigerRequest.ApiMethodName。
请求
TigerRequest<OrderBatchResponse>ModelValue: QueryOrderModel.
参数
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | CLR 默认值;序列化时省略 | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | 为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败 |
SecretKey | string | secret_key | null | no | — |
Id | Int64 | id | CLR 默认值;序列化时省略 | Required | — |
IsShowCharges | Boolean | show_charges | CLR 默认值;序列化时省略 | Optional | — |
SegType | SegmentType | seg_type | CLR 默认值;序列化时省略 | Optional | — |
SecType | SecType | sec_type | CLR 默认值;序列化时省略 | Optional | — |
Market | Market | market | CLR 默认值;序列化时省略 | Optional | Enum value |
Symbol | string | symbol | null | Required | — |
Right | string (nullable) | right | null | Optional | — |
Strike | string (nullable) | strike | null | Optional | — |
Expiry | string (nullable) | expiry | null | Optional | — |
StartDate | Int64 | start_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
EndDate | Int64 | end_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
Limit | Int32 | limit | 100 | Optional | Positive integer |
SortBy | OrderSortBy | sort_by | CLR 默认值;序列化时省略 | Optional | — |
PageToken | string | page_token | null | Optional | — |
返回
OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem. Key SDK fields: Items: list of TradeOrder.
示例
TigerRequest<OrderBatchResponse> request = new()
{
ApiMethodName = TradeApiService.FILLED_ORDERS,
ModelValue = new QueryOrderModel { Account = tradeClient.GetDefaultAccount, Id = 1234567890L, SegType = SegmentType.SEC, SecType = SecType.STK, Market = Market.US }
};
OrderBatchResponse? response = await tradeClient.ExecuteAsync(request);响应类型
OrderBatchItem? data = response?.Data; // response 或 data 缺失时为 null返回示例
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": {
"items": [
{
"id": 123456,
"orderId": 789012,
"symbol": "AAPL",
"action": "BUY",
"orderType": "LMT",
"totalQuantity": 100,
"filledQuantity": 100,
"limitPrice": 150.0,
"avgFillPrice": 149.95,
"status": "Filled"
}
]
}
}频率限制
基础额度:每分钟 120 次。
获取成交记录
操作名
TradeApiService.ORDER_TRANSACTIONS = order_transactions。该常量用于设置 TigerRequest.ApiMethodName。
请求
TigerRequest<OrderTransactionsResponse>ModelValue: OrderTransactionsModel.
参数
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | CLR 默认值;序列化时省略 | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | 为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败 |
SecretKey | string | secret_key | null | no | — |
OrderId | Int64 | order_id | CLR 默认值;序列化时省略 | Optional | — |
SecType | SecType | sec_type | CLR 默认值;序列化时省略 | Optional | — |
Symbol | string | symbol | null | Required | — |
Right | string (nullable) | right | null | Optional | — |
Strike | string (nullable) | strike | null | Optional | — |
Expiry | string (nullable) | expiry | null | Optional | — |
StartDate | Int64 | start_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
EndDate | Int64 | end_date | CLR 默认值;序列化时省略 | Optional | Timestamp or date format; maintain chronological order |
Limit | Int32 | limit | 20 | Optional | Positive integer |
返回
OrderTransactionsResponse inherits TigerResponse; its data property is OrderTransactionsItem. Key SDK fields: Items: list of OrderTransactions.
示例
TigerRequest<OrderTransactionsResponse> request = new()
{
ApiMethodName = TradeApiService.ORDER_TRANSACTIONS,
ModelValue = new OrderTransactionsModel { Account = tradeClient.GetDefaultAccount, OrderId = 1234567890L, SecType = SecType.STK, Symbol = "AAPL", Strike = "200" }
};
OrderTransactionsResponse? response = await tradeClient.ExecuteAsync(request);响应类型
OrderTransactionsItem? data = response?.Data; // response 或 data 缺失时为 null返回示例
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{
"id": 123456,
"orderId": 789012,
"symbol": "AAPL",
"action": "BUY",
"filledQuantity": 100,
"filledPrice": 149.95,
"transactionTime": 1785441650000
}
]
}频率限制
基础额度:每分钟 60 次。
Updated 7 days ago
