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"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
id | String | N | Client-defined request ID. Echoed back in the response. |
action | String | Y | Must be replace_algo_order. |
args | Object | Y | Replace parameters. |
> algoOrderId | String | N | LTP-assigned algo order ID to amend. |
> clientOrderId | String | N | Your own order ID to amend. Only lowercase letters (a-z) and digits (0-9). |
> orderQty | String | N | New order quantity. |
> conditionalTriggerPrice | String | N | New conditional trigger price. |
> conditionalTriggerType | String | N | Price type for the conditional trigger: LAST_PRICE or MARK_PRICE. |
> conditionalPrice | String | N | New limit price after trigger fires. "0" means market price. |
> tpTriggerPrice | String | N | New take-profit trigger price. |
> tpTriggerType | String | N | Price type for the take-profit trigger: LAST_PRICE or MARK_PRICE (default: LAST_PRICE). |
> tpPrice | String | N | New take-profit execution price. "0" means market price. |
> slTriggerPrice | String | N | New stop-loss trigger price. |
> slTriggerType | String | N | Price type for the stop-loss trigger: LAST_PRICE or MARK_PRICE (default: LAST_PRICE). |
> slPrice | String | N | New 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: 0means LTP has accepted the replace request. The algo order ID is unchanged — replace does not create a new order. Monitor theALGO_ORDERpush channel to confirm the updated parameters are in effect.
| Field | Type | Description |
|---|---|---|
id | String | Echoed client request ID. |
event | String | replace_algo_order on success, error on failure. |
code | Long | 0 = replace request accepted. Any other value indicates an error — check msg for the reason. |
msg | String | Empty on success, or an error message on failure. |
data | Object | Present on success only. |
> algoOrderId | String | Algo order ID. Unchanged from the original order. |
> clientOrderId | String | Your own order ID, if one was assigned. |
