Cancel or Modify Orders
About 1 min
Modify Orders
Request:TigerRequest(TradeApiService.MODIFY_ORDER)
Description
Modify Orders. 'order_type' cann't be modified.
Argument
Argument | Type | Required | Description |
---|---|---|---|
account | string | Yes | Account id: DU575569 |
id | long | Yes | Order id. You will get this ID after placing an order |
total_quantity | long | No | Order's new quantity (There is a minimum quantity requirement for HK market) |
total_quantity_scale | int | No | The 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_price | double | No | Limit price, required if placing a limit order (inluding LMT and STP_LMT) |
aux_price | double | No | Auxilary price. it represents the stop price if placing a stop price, trailing price if placing a trailing stop order |
trailing_percent | double | No | Trailing 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_key | string | No | Secret key for the trader of institutions, please config in client_config, ignore if you are a indiviual user |
Response
Name | Type | Description |
---|---|---|
id | long | order 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
Argument | Type | Required | Description |
---|---|---|---|
account | string | Yes | Account id :DU575569 |
id | long | Yes | Order id. You will get this ID after placing an order |
secret_key | string | No | Institutional trader's secret key. Only applicable to institutional users. Configured in client_config |
Response
Name | Type | Description |
---|---|---|
id | long | order 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="
}