修改与撤销订单

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

改单

操作名

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

请求

TigerRequest<TigerDictResponse>

ModelValue: ModifyOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
IdlongidNone (omitted if not set)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: 动态字段.

示例

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

撤单

操作名

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

请求

TigerRequest<TigerDictResponse>

ModelValue: CancelOrderModel.

参数

SDK propertyC# typeAPI fieldSDK defaultRequiredConstraints
LangLanguagelangNone (omitted if not set)no
Accountstring (nullable)accountnullAuto-filled if emptyTradeClient uses DefaultAccount when empty
SecretKeystringsecret_keynullno
IdlongidNone (omitted if not set)Required

返回

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

示例

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

Did this page help you?