修改与撤销订单

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

改单

操作名

TradeApiService.MODIFY_ORDER = modify_order。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<TigerDictResponse>

ModelValue: ModifyOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
IdlongidCLR 默认值;序列化时省略Required
OrderTypeOrderType (nullable)order_typenullOptionalprice fields are conditionally required by order type
TotalQuantityInt64 (nullable)total_quantitynullOptional
TotalQuantityScaleInt32 (nullable)total_quantity_scalenullOptional
LimitPriceDouble (nullable)limit_pricenullOptionalconditional order-price field
AuxPriceDouble (nullable)aux_pricenullOptionalconditional order-price field
TrailingPercentDouble (nullable)trailing_percentnullOptionalconditional order-price field
CashAmountDouble (nullable)cash_amountnullOptional
DisplaySizeInt64 (nullable)display_sizenullOptional
MinDisplaySizeInt64 (nullable)min_display_sizenullOptional
PriceTypestring (nullable)price_typenullOptional
CheckIntervalsInt64 (nullable)check_intervalsnullOptional
StartTimeInt64 (nullable)start_timenullOptionalTimestamp or date format; maintain chronological order
EndTimeInt64 (nullable)end_timenullOptionalTimestamp or date format; maintain chronological order

返回

TigerDictResponse inherits TigerResponse; its data property is 字典,键为 string,值为 object. Key SDK fields: 动态字段.

成功响应中的订单 ID 只表示改单请求已提交。请继续查询订单;ReplaceStatus=REPLACED 才表示改单已确认成功,FAILED 表示失败,其他状态仍需结合订单 Status 继续等待。

示例

TigerRequest<TigerDictResponse> request = new()
{
    ApiMethodName = TradeApiService.MODIFY_ORDER,
    ModelValue = new ModifyOrderModel { Account = tradeClient.GetDefaultAccount, Id = 1234567890L, OrderType = OrderType.LMT, TotalQuantity = 1, LimitPrice = 200.0 }
};
TigerDictResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

Dictionary<string, object>? data = response?.Data; // response 或 data 缺失时为 null

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": {
    "id": 123456,
    "orderId": 789012
  }
}

频率限制

基础额度:每分钟 120 次

撤单

操作名

TradeApiService.CANCEL_ORDER = cancel_order。该常量用于设置 TigerRequest.ApiMethodName

请求

TigerRequest<TigerDictResponse>

ModelValue: CancelOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangCLR 默认值;序列化时省略no
Accountstring (nullable)accountnullAuto-filled if empty为空时 TradeClientTigerConfig.DefaultAccount 注入;若仍为空则验证失败
SecretKeystringsecret_keynullno
IdlongidCLR 默认值;序列化时省略Required

返回

TigerDictResponse inherits TigerResponse; its data property is 字典,键为 string,值为 object. Key SDK fields: 动态字段.

成功响应中的订单 ID 只表示撤单请求已提交。请继续查询订单,直到 Status=Cancelled,或订单因抢先成交等原因进入其他最终状态;不要把 CancelStatus=RECEIVED 当作撤单完成。

示例

TigerRequest<TigerDictResponse> request = new()
{
    ApiMethodName = TradeApiService.CANCEL_ORDER,
    ModelValue = new CancelOrderModel { Account = tradeClient.GetDefaultAccount, Id = 1234567890L }
};
TigerDictResponse? response = await tradeClient.ExecuteAsync(request);

响应类型

Dictionary<string, object>? data = response?.Data; // response 或 data 缺失时为 null

返回示例

{
  "code": 0,
  "message": "success",
  "timestamp": 1785528000000,
  "data": {
    "id": 123456,
    "orderId": 789012
  }
}

频率限制

基础额度:每分钟 120 次


Did this page help you?