Cancel or Modify Orders

About 1 min

Modify Orders TigerHttpRequest(MethodName.MODIFY_ORDER)

Description

Modify Orders. 'order_type' can'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_pricedoubleNoAuxiliary 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

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

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

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
  }
}
Last update: