订单查询

状态变更操作必须防止重复提交。

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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—

返回

TigerDictResponse inherits TigerResponse; its data property is Dictionary<string, object>.

示例

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

Data 字段

类型SDK 约定
Dictionary<string, object>动态字典;SDK 未定义固定键或嵌套对象类型。

频率限制

基础额度:每分钟 120 次。

获取订单列表

操作名

TradeApiService.ORDERS = orders。该常量用于设置 TigerRequest.ApiMethodName。

请求

TigerRequest<OrderBatchResponse>

ModelValue: QueryOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
IdInt64idCLR 默认值;序列化时省略Required—
IsShowChargesBooleanshow_chargesCLR 默认值;序列化时省略Optional—
SegTypeSegmentTypeseg_typeCLR 默认值;序列化时省略Optional—
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional—
MarketMarketmarketCLR 默认值;序列化时省略OptionalEnum value
SymbolstringsymbolnullRequired—
Rightstring (nullable)rightnullOptional—
Strikestring (nullable)strikenullOptional—
Expirystring (nullable)expirynullOptional—
StartDateInt64start_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
EndDateInt64end_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional仅支持综合账户。LATEST_CREATED:按订单创建/提交时间降序排序并按该时间筛选;LATEST_STATUS_UPDATED:按最近一次订单状态更新时间降序排序并按该时间筛选。
PageTokenstringpage_tokennullOptional—

时间范围说明:SortBy 决定排序以及 StartDate、EndDate 所筛选的时间:LATEST_CREATED 使用订单创建/提交时间,LATEST_STATUS_UPDATED 使用最近一次订单状态更新时间。NONE 或省略 SortBy 时,C# 序列化器不发送 sort_by 字段,综合账户服务端默认 LATEST_CREATED。StartDate 和 EndDate 均可选;省略任一边界时,该边界不参与筛选。接口不限制最大时间跨度,但分页和单次返回数量限制仍然适用。建议指定合理的起止时间范围。

返回

OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem.

示例

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

Data 字段(OrderBatchItem)

字段API 字段C# 类型说明
NextPageTokennextPageTokenstring下一页令牌
ItemsitemsList<TradeOrder>订单列表

Items 中每个 TradeOrder:

字段API 字段C# 类型说明
Symbolsymbolstring合约代码
Marketmarketstring所属市场
SecTypesecTypestring证券类型
Currencycurrencystring计价币种
Expiryexpirystring到期日
Strikestrikestring行权价
Rightrightstring期权方向
Multipliermultiplierdouble合约乘数
Identifieridentifierstring合约标识
IdidInt64订单标识
OrderIdorderIdint订单号
ExternalIdexternalIdstring外部订单标识
ParentIdparentIdInt64父订单标识
Accountaccountstring账户号
Actionactionstring买卖方向
OrderTypeorderTypestring订单类型
LimitPricelimitPriceDouble限价
AuxPriceauxPriceDouble辅助价格
TrailingPercenttrailingPercentDouble跟踪百分比
TotalQuantitytotalQuantityInt64委托总数量
TotalQuantityScaletotalQuantityScaleInt32委托数量小数位数
FilledQuantityfilledQuantityInt64已成交数量
FilledQuantityScalefilledQuantityScaleInt32成交数量小数位数
TotalCashAmounttotalCashAmountDouble委托总金额
FilledCashAmountfilledCashAmountDouble已成交金额
RefundCashAmountrefundCashAmountDouble已退回金额
LastFillPricelastFillPriceDouble最近成交价
AvgFillPriceavgFillPriceDouble平均成交价
TimeInForcetimeInForcestring有效期类型
ExpireTimeexpireTimeInt64到期时间戳
GoodTillDategoodTillDatestring有效截止日期
OutsideRthoutsideRthBoolean是否允许常规交易时段外交易
TradingSessionTypetradingSessionTypestring交易时段类型
CommissioncommissionDouble佣金
GstgstDouble商品及服务税
RealizedPnlrealizedPnlDouble已实现盈亏
Remarkremarkstring订单备注
LiquidationliquidationBoolean是否为强制平仓订单
TriggerStatustriggerStatusstring条件单触发状态
OpenTimeopenTimeInt64订单创建时间戳
UpdateTimeupdateTimeInt64订单更新时间戳
LatestTimelatestTimeInt64最近状态更新时间戳
Namenamestring合约名称
LatestPricelatestPriceDouble最新价
AttrDescattrDescstring订单属性说明
UserMarkuserMarkstring用户标记
AttrListattrListList<string>订单属性列表
OcaGroupIdocaGroupIdintOCA 订单组标识
ComboLegscomboLegsstring组合订单腿信息
AllocAccountsallocAccountsList<string>分配账户列表
AllocSharesallocSharesList<Double>账户分配数量列表
AlgoStrategyalgoStrategystring算法策略
AlgoParametersalgoParametersList<TagValue>算法参数列表
StatusstatusOrderStatus订单状态
ReplaceStatusreplaceStatusstring改单状态
CancelStatuscancelStatusstring撤单状态
Sourcesourcestring订单来源
DiscountdiscountInt32折扣
CanModifycanModifyBoolean是否可改单
CanCancelcanCancelBoolean是否可撤单
IsOpenisOpenBoolean是否为未完成订单
ComboTypecomboTypestring组合订单类型
ComboTypeDesccomboTypeDescstring组合订单类型说明
LegslegsList<OrderLeg>订单腿列表

每个 AlgoParameters 元素是 TagValue:

字段API 字段C# 类型说明
Tagtagstring参数名称
Valuevaluestring?参数值

每个 Legs 元素是 OrderLeg:

字段API 字段C# 类型说明
Marketmarketstring所属市场
Currencycurrencystring计价币种
MultipliermultiplierDouble合约乘数
TotalQuantitytotalQuantityDouble委托总数量
FilledQuantityfilledQuantityDouble已成交数量
AvgFilledPriceavgFilledPriceDouble平均成交价
CreatedAtcreatedAtInt64创建时间戳
UpdatedAtupdatedAtInt64更新时间戳

返回示例

{
  "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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
IdInt64idCLR 默认值;序列化时省略Required—
IsShowChargesBooleanshow_chargesCLR 默认值;序列化时省略Optional—
SegTypeSegmentTypeseg_typeCLR 默认值;序列化时省略Optional—
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional—
MarketMarketmarketCLR 默认值;序列化时省略OptionalEnum value
SymbolstringsymbolnullRequired—
Rightstring (nullable)rightnullOptional—
Strikestring (nullable)strikenullOptional—
Expirystring (nullable)expirynullOptional—
StartDateInt64start_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
EndDateInt64end_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional仅支持综合账户。LATEST_CREATED:按订单创建/提交时间降序排序并按该时间筛选;LATEST_STATUS_UPDATED:按最近一次订单状态更新时间降序排序并按该时间筛选。NONE 或省略时不序列化该字段,服务端默认 LATEST_CREATED。
PageTokenstringpage_tokennullOptional—

返回

OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem.

示例

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

Data 字段

字段API 字段C# 类型说明
NextPageTokennextPageTokenstring下一页令牌
ItemsitemsList<TradeOrder>订单列表

TradeOrder 的完整字段见获取订单列表的 Data 字段。

返回示例

{
  "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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
IdInt64idCLR 默认值;序列化时省略Required—
IsShowChargesBooleanshow_chargesCLR 默认值;序列化时省略Optional—
SegTypeSegmentTypeseg_typeCLR 默认值;序列化时省略Optional—
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional—
MarketMarketmarketCLR 默认值;序列化时省略OptionalEnum value
SymbolstringsymbolnullRequired—
Rightstring (nullable)rightnullOptional—
Strikestring (nullable)strikenullOptional—
Expirystring (nullable)expirynullOptional—
StartDateInt64start_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
EndDateInt64end_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional仅支持综合账户。LATEST_CREATED:按订单创建/提交时间降序排序并按该时间筛选;LATEST_STATUS_UPDATED:按最近一次订单状态更新时间降序排序并按该时间筛选。NONE 或省略时不序列化该字段,服务端默认 LATEST_CREATED。
PageTokenstringpage_tokennullOptional—

返回

OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem.

示例

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

Data 字段

字段API 字段C# 类型说明
NextPageTokennextPageTokenstring下一页令牌
ItemsitemsList<TradeOrder>订单列表

TradeOrder 的完整字段见获取订单列表的 Data 字段。

返回示例

{
  "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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
IdInt64idCLR 默认值;序列化时省略Required—
IsShowChargesBooleanshow_chargesCLR 默认值;序列化时省略Optional—
SegTypeSegmentTypeseg_typeCLR 默认值;序列化时省略Optional—
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional—
MarketMarketmarketCLR 默认值;序列化时省略OptionalEnum value
SymbolstringsymbolnullRequired—
Rightstring (nullable)rightnullOptional—
Strikestring (nullable)strikenullOptional—
Expirystring (nullable)expirynullOptional—
StartDateInt64start_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
EndDateInt64end_dateCLR 默认值;序列化时省略Optional时间戳或日期格式;按 SortBy 选定的时间筛选,并保持时间顺序
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional仅支持综合账户。LATEST_CREATED:按订单创建/提交时间降序排序并按该时间筛选;LATEST_STATUS_UPDATED:按最近一次订单状态更新时间降序排序并按该时间筛选。NONE 或省略时不序列化该字段,服务端默认 LATEST_CREATED。
PageTokenstringpage_tokennullOptional—

返回

OrderBatchResponse inherits TigerResponse; its data property is OrderBatchItem.

示例

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

Data 字段

字段API 字段C# 类型说明
NextPageTokennextPageTokenstring下一页令牌
ItemsitemsList<TradeOrder>订单列表

TradeOrder 的完整字段见获取订单列表的 Data 字段。

返回示例

{
  "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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no—
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClient 从 TigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno—
OrderIdInt64order_idCLR 默认值;序列化时省略Optional—
SecTypeSecTypesec_typeCLR 默认值;序列化时省略Optional—
SymbolstringsymbolnullRequired—
Rightstring (nullable)rightnullOptional—
Strikestring (nullable)strikenullOptional—
Expirystring (nullable)expirynullOptional—
StartDateInt64start_dateCLR 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateCLR 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
LimitInt32limit20OptionalPositive integer

返回

OrderTransactionsResponse inherits TigerResponse; its data property is OrderTransactionsItem.

示例

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

Data 字段(OrderTransactionsItem)

字段API 字段C# 类型说明
ItemsitemsList<OrderTransactions>成交记录列表

Items 中每个 OrderTransactions:

字段API 字段C# 类型说明
IdidInt64成交记录标识
OrderIdorderIdInt64订单标识
AccountIdaccountIdstring账户标识
SecTypesecTypestring证券类型
Marketmarketstring所属市场
Currencycurrencystring计价币种
Symbolsymbolstring合约代码
Expiryexpirystring到期日
Strikestrikestring行权价
Rightrightstring期权方向
Actionactionstring买卖方向
FilledQuantityfilledQuantityInt64成交数量
FilledPricefilledPriceDouble成交价格
FilledAmountfilledAmountDouble成交金额
TransactedAttransactedAtstring成交时间
TransactionTimetransactionTimeInt64成交时间戳

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": [
    {
      "id": 123456,
      "orderId": 789012,
      "symbol": "AAPL",
      "action": "BUY",
      "filledQuantity": 100,
      "filledPrice": 149.95,
      "transactionTime": 1785441650000
    }
  ]
}

频率限制

基础额度:每分钟 60 次。


Did this page help you?