Cancel Algo Order

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"
  }
}
FieldTypeRequiredDescription
idStringNClient-defined request ID. Echoed back in the response.
actionStringYMust be cancel_algo_order.
argsObjectYCancellation parameters.
> algoOrderIdStringNLTP-assigned algo order ID to cancel.
> clientOrderIdStringNYour own order ID to cancel. Only lowercase letters (a-z) and digits (0-9).

For TPSL orders, provide either algoOrderId or clientOrderId. For ATTACHED_TPSL orders, provide either orderId or clientOrderId. 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: 0 means LTP has accepted the cancellation request. Monitor the ALGO_ORDER push channel for orderState: "CANCELLED" to confirm the order has been cancelled.

FieldTypeDescription
idStringEchoed client request ID.
eventStringcancel_algo_order on success, error on failure.
codeLong0 = cancellation 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 of the order being cancelled.
> clientOrderIdStringYour own order ID, if one was assigned.