Rate Limit: 3 requests per 10 seconds
Cancel an existing algorithmic order by its algo order ID or client order ID. The response confirms LTP has accepted the cancellation request. Monitor the ALGO_ORDER push channel for orderState: "CANCELLED" to confirm.
Rate Limit: 3 requests per 10 seconds
Request
Identify the order using either algoOrderId or clientOrderId. If you provide both, algoOrderId takes precedence.
{
"id": "XXX",
"action": "cancel_algo_order",
"args": {
"algoOrderId": "XXX",
"clientOrderId": "XXXX"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
id | String | N | Client-defined request ID. Echoed back in the response. |
action | String | Y | Must be cancel_algo_order. |
args | Object | Y | Cancellation parameters. |
> algoOrderId | String | N | LTP-assigned algo order ID to cancel. |
> clientOrderId | String | N | Your own order ID to cancel. Only lowercase letters (a-z) and digits (0-9). |
For TPSL orders, provide either
algoOrderIdorclientOrderId. For ATTACHED_TPSL orders, provide eitherorderIdorclientOrderId. At least one identifier must be provided.
Response
Success:
{
"id": "XXXX",
"event": "cancel_algo_order",
"code": 0,
"msg": "",
"data": {
"algoOrderId": "XXXX",
"clientOrderId": "XXXX"
}
}
Failure:
{
"id": "***",
"event": "error",
"code": "60009",
"msg": "Cancel Order failed."
}
code: 0means LTP has accepted the cancellation request. Monitor theALGO_ORDERpush channel fororderState: "CANCELLED"to confirm the order has been cancelled.
| Field | Type | Description |
|---|---|---|
id | String | Echoed client request ID. |
event | String | cancel_algo_order on success, error on failure. |
code | Long | 0 = cancellation 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 of the order being cancelled. |
> clientOrderId | String | Your own order ID, if one was assigned. |
