Replace Algo Order

Rate Limit: 3 requests per 10 seconds

Amend an existing algorithmic order — update its quantity, conditional trigger price, or TP/SL parameters. The algo order ID remains unchanged. Monitor the ALGO_ORDER push channel to confirm the amendment has taken effect.

Rate Limit: 3 requests per 10 seconds


Request

Identify the order using either algoOrderId or clientOrderId. Only include the fields you want to change — any field you omit keeps its current value.

{
  "id": "ws-1735611102",
  "action": "replace_algo_order",
  "args": {
    "algoOrderId": "",
    "clientOrderId": "1737615509395024000",
    "orderQty": "0.01",
    "tpTriggerPrice": "632",
    "tpTriggerType": "MARK_PRICE",
    "tpPrice": "732.1",
    "slTriggerPrice": "742",
    "slTriggerType": "LAST_PRICE",
    "slPrice": "0"
  }
}
FieldTypeRequiredDescription
idStringNClient-defined request ID. Echoed back in the response.
actionStringYMust be replace_algo_order.
argsObjectYReplace parameters.
> algoOrderIdStringNLTP-assigned algo order ID to amend.
> clientOrderIdStringNYour own order ID to amend. Only lowercase letters (a-z) and digits (0-9).
> orderQtyStringNNew order quantity.
> conditionalTriggerPriceStringNNew conditional trigger price.
> conditionalTriggerTypeStringNPrice type for the conditional trigger: LAST_PRICE or MARK_PRICE.
> conditionalPriceStringNNew limit price after trigger fires. "0" means market price.
> tpTriggerPriceStringNNew take-profit trigger price.
> tpTriggerTypeStringNPrice type for the take-profit trigger: LAST_PRICE or MARK_PRICE (default: LAST_PRICE).
> tpPriceStringNNew take-profit execution price. "0" means market price.
> slTriggerPriceStringNNew stop-loss trigger price.
> slTriggerTypeStringNPrice type for the stop-loss trigger: LAST_PRICE or MARK_PRICE (default: LAST_PRICE).
> slPriceStringNNew stop-loss execution price. "0" means market price.

Response

Success:

{
  "id": "XXXX",
  "event": "replace_algo_order",
  "code": 0,
  "msg": "",
  "data": {
    "algoOrderId": "XXXXX",
    "clientOrderId": "XXXXX"
  }
}

Failure:

{
  "id": "***",
  "event": "error",
  "code": "60009",
  "msg": "Create order failed."
}

code: 0 means LTP has accepted the replace request. The algo order ID is unchanged — replace does not create a new order. Monitor the ALGO_ORDER push channel to confirm the updated parameters are in effect.

FieldTypeDescription
idStringEchoed client request ID.
eventStringreplace_algo_order on success, error on failure.
codeLong0 = replace request accepted. Any other value indicates an error — check msg for the reason.
msgStringEmpty on success, or an error message on failure.
dataObjectPresent on success only.
> algoOrderIdStringAlgo order ID. Unchanged from the original order.
> clientOrderIdStringYour own order ID, if one was assigned.