订单查询

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

TradeOrder 中的 AvgFillPrice 是按成交价格加权计算的平均成交价,不含佣金和其他费用。RealizedPnl 是已实现盈亏;CommissionGst 通过独立字段返回。准确的计算口径和币种请以账户结单为准。CommissionGstAvgFillPriceRealizedPnl 在此 SDK 中为非可空 Double,因此无法区分字段缺失和明确返回的 0ReplaceStatus=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为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno

返回

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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.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 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateCLR 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional
PageTokenstringpage_tokennullOptional

时间范围说明StartDateEndDate 均可选;省略任一边界时,该边界不参与筛选。接口不限制最大时间跨度,但分页和单次返回数量限制仍然适用。建议指定合理的起止时间范围。

返回

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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.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 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateCLR 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional
PageTokenstringpage_tokennullOptional

返回

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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.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 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateCLR 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional
PageTokenstringpage_tokennullOptional

返回

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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.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 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateCLR 默认值;序列化时省略OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byCLR 默认值;序列化时省略Optional
PageTokenstringpage_tokennullOptional

返回

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 propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.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. 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 次


Did this page help you?