Cancel or Modify Orders
About 1 min
Modify Orders TigerHttpRequest(MethodName.MODIFY_ORDER)
Description
Modify Orders. 'order_type' can'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 | Auxiliary 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
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(ClientConfig.DEFAULT_CONFIG);
TigerHttpRequest request = new TigerHttpRequest(MethodName.MODIFY_ORDER);
String bizContent = TradeParamBuilder.instance()
.account("DU575569")
.id(147070683398615040L)
.totalQuantity(200)
.limitPrice(60.0)
.buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);
JSONObject data = JSON.parseObject(response.getData());
Long id = data.getLong("id");
Response Example
{
"code": 0,
"message": null,
"timestamp": 1525938835697,
"data": {
"id":147070683398615040
}
}
Cancel Order TigerHttpRequest(MethodName.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
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(ClientConfig.DEFAULT_CONFIG);
TigerHttpRequest request = new TigerHttpRequest(MethodName.CANCEL_ORDER);
String bizContent = TradeParamBuilder.instance()
.account("DU575569")
.id(147070683398615040L)
.buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);
JSONObject data = JSON.parseObject(response.getData());
Long id = data.getLong("id");
Response Example
{
"code": 0,
"message": null,
"timestamp": 1525938835697,
"data": {
"id":147070683398615040
}
}