订单查询

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

获取订单号

操作名

TradeApiService.ORDER_NO = order_no. 使用服务端方法 order_no。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<TigerDictResponse>

ModelValue: TradeModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
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

获取订单列表

操作名

TradeApiService.ORDERS = orders. 使用服务端方法 orders。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<OrderBatchResponse>

ModelValue: QueryOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
IdInt64idNone (omitted if not set)Required
IsShowChargesBooleanshow_chargesNone (omitted if not set)Optional
SegTypeSegmentTypeseg_typeNone (omitted if not set)Optional
SecTypeSecTypesec_typeNone (omitted if not set)Optional
MarketMarketmarketNone (omitted if not set)OptionalEnum value
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
StartDateInt64start_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byNone (omitted if not set)Optional
PageTokenstringpage_tokennullOptional

返回

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
      }
    ]
  }
}

获取待成交订单

操作名

TradeApiService.ACTIVE_ORDERS = active_orders. 使用服务端方法 active_orders。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<OrderBatchResponse>

ModelValue: QueryOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
IdInt64idNone (omitted if not set)Required
IsShowChargesBooleanshow_chargesNone (omitted if not set)Optional
SegTypeSegmentTypeseg_typeNone (omitted if not set)Optional
SecTypeSecTypesec_typeNone (omitted if not set)Optional
MarketMarketmarketNone (omitted if not set)OptionalEnum value
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
StartDateInt64start_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byNone (omitted if not set)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
      }
    ]
  }
}

获取已撤销订单

操作名

TradeApiService.INACTIVE_ORDERS = inactive_orders. 使用服务端方法 inactive_orders。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<OrderBatchResponse>

ModelValue: QueryOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
IdInt64idNone (omitted if not set)Required
IsShowChargesBooleanshow_chargesNone (omitted if not set)Optional
SegTypeSegmentTypeseg_typeNone (omitted if not set)Optional
SecTypeSecTypesec_typeNone (omitted if not set)Optional
MarketMarketmarketNone (omitted if not set)OptionalEnum value
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
StartDateInt64start_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byNone (omitted if not set)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"
      }
    ]
  }
}

获取已成交订单

操作名

TradeApiService.FILLED_ORDERS = filled_orders. 使用服务端方法 filled_orders。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<OrderBatchResponse>

ModelValue: QueryOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
IdInt64idNone (omitted if not set)Required
IsShowChargesBooleanshow_chargesNone (omitted if not set)Optional
SegTypeSegmentTypeseg_typeNone (omitted if not set)Optional
SecTypeSecTypesec_typeNone (omitted if not set)Optional
MarketMarketmarketNone (omitted if not set)OptionalEnum value
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
StartDateInt64start_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
LimitInt32limit100OptionalPositive integer
SortByOrderSortBysort_byNone (omitted if not set)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"
      }
    ]
  }
}

获取成交记录

操作名

TradeApiService.ORDER_TRANSACTIONS = order_transactions. 使用服务端方法 order_transactions。这是 *ApiService 常量,不是客户端成员方法。

请求

TigerRequest<OrderTransactionsResponse>

ModelValue: OrderTransactionsModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
OrderIdInt64order_idNone (omitted if not set)Optional
SecTypeSecTypesec_typeNone (omitted if not set)Optional
SymbolstringsymbolnullRequired
Rightstring (nullable)rightnullOptional
Strikestring (nullable)strikenullOptional
Expirystring (nullable)expirynullOptional
StartDateInt64start_dateNone (omitted if not set)OptionalTimestamp or date format; maintain chronological order
EndDateInt64end_dateNone (omitted if not set)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
    }
  ]
}

Did this page help you?