Cancel or Modify Orders

About 1 min

Modify Orders

Request:TigerRequest(TradeApiService.MODIFY_ORDER)

Description

Modify Orders. 'order_type' cann't be modified.

Argument

ArgumentTypeRequiredDescription
accountstringYesAccount id: DU575569
idlongYesOrder id. You will get this ID after placing an order
total_quantitylongNoOrder's new quantity (There is a minimum quantity requirement for HK market)
total_quantity_scaleintNoThe offset of the order quantity, default is 0. The combination of 'total_quantity' and 'total_quantity_scale' of odd lot orders represents the actual order quantity. For example, total_quantity=111 total_quantity_scale=2, then the real quantity=111*10^(-2)=1.11
limit_pricedoubleNoLimit price, required if placing a limit order (inluding LMT and STP_LMT)
aux_pricedoubleNoAuxilary price. it represents the stop price if placing a stop price, trailing price if placing a trailing stop order
trailing_percentdoubleNoTrailing activation price for trailing stop orders (by percentage). When the order type is TRAIL, 'aux_price' will be ignored when 'trailing_percent' already has a value
secret_keystringNoSecret key for the trader of institutions, please config in client_config, ignore if you are a indiviual user

Response

NameTypeDescription
idlongorder id. This ID is a unique value and can be used to locate,modify or cancel an order.

Example

  static async Task<TigerDictResponse?> ModifyOrderAsync(TradeClient tradeClient)
  {
    TigerRequest<TigerDictResponse> request = new TigerRequest<TigerDictResponse>()
    {
      ApiMethodName = TradeApiService.MODIFY_ORDER,
      ModelValue = new ModifyOrderModel()
      {
        Account = "20200821144442583",// tradeClient.GetDefaultAccount,
        Id = 29360305075913728,
        LimitPrice = 121.0,
        TotalQuantity = 2
      }
    };
    return await tradeClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "id":29360305075913728
    },
    "code": 0,
    "message":"success",
    "timestamp":1672916823517,
    "sign":"qVwjFIhphTMTblhMQ2S1Py916Q0YJ/MjlOfUJxyqCKoAYfxfhiKkUGnL6CCO5Sak7IfQkkIgemPorcyTrfOZIXK8hxVayzPB3lYRo/Ip9woJA5Muh8eFYdqcR000GJreBPAEVl6B8t+mzrptjRS798QCxi/uxsbv6WzSCdmd1XY="
}

Cancel Order

Request:TigerRequest(TradeApiService.CANCEL_ORDER)

Description

Cancel Orders

Argument

ArgumentTypeRequiredDescription
accountstringYesAccount id :DU575569
idlongYesOrder id. You will get this ID after placing an order
secret_keystringNoInstitutional trader's secret key. Only applicable to institutional users. Configured in client_config

Response

NameTypeDescription
idlongorder id. This ID can be used to locate,modify or cancel an order.

Example

  static async Task<TigerDictResponse?> CancelOrderAsync(TradeClient tradeClient)
  {
    TigerRequest<TigerDictResponse> request = new TigerRequest<TigerDictResponse>()
    {
      ApiMethodName = TradeApiService.CANCEL_ORDER,
      ModelValue = new CancelOrderModel()
      {
        Account = "20200821144442583",// tradeClient.GetDefaultAccount,
        Id = 29360305075913728
      }
    };
    return await tradeClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "id":29360305075913728
    },
    "code": 0,
    "message":"success",
    "timestamp":1672917172001,
    "sign":"QZnYKt55byk4/jwCsniS1y+BExrEUUGHiNGmRMGnBPBnR8nW8Knu15hUjjOfonDhIV+xpGLb3LrBt6hEEp8+dhG/aflx4CCCf5ivMNiOPk1epr4gMGlFmclTmqf9c5Mc3rqGqKxM3b05Qk9bLr4OLCPPk7oA6b86rvnc/ZHymWM="
}
Last update: