POST Cancel Orders
- NT8
- Tradovate
Cancel orders by account and/or instrument NT8
Cancels working orders for one account, optionally limited to a specific instrument.
Endpoint
POST /v1/api/accounts/{account}/orders/cancel
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Name of account in NT8 |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Optional | Optional name of instrument |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/cancel"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {
# "instrument": "MES 12-25"
}
try:
response = requests.post(url, headers=headers, json=data)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
const token = 'my-secret-token';
const url = "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/cancel";
const data = {
// instrument: "MES 12-25"
};
fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X POST "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/cancel" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
Response
- 200
- 400
{
"orderIds": [
"adb3868865de4b59b0e147b8300e4a29",
"2141df9fc0254ba9b34c8a5e38722249",
"16f6774e302748ce962f2d60b58b2eb1"
],
"success": true
}
{
"error": "Invalid request"
}
Platform nuances
When instrument is omitted, all working orders across the entire account are cancelled. When instrument is provided, only orders for that instrument are affected. Use the instrument filter when you want to cancel protective orders on a specific position without touching orders on other instruments in the same account.
WebSocket API
This request can also be made over the WebSocket API. The account path parameter and request body fields are all passed inside args.
{
"action": "rpc",
"id": "my-request-id",
"api": "CancelOrders",
"args": {
"account": "Sim101",
"instrument": "ES 09-26"
}
}
Cancel orders by account and/or instrument Tradovate
Cancels working orders on one linked Tradovate account, optionally narrowed to one instrument. No NinjaTrader add-on is involved: the command runs server-side with the same validation, Account Manager locks, and Trade Copier fan-out as a webhook signal.
Endpoint
POST /v1/api/tv/accounts/{account}/orders/cancel
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Tradovate account name, for example DEMO12345678. |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument | string | Optional | Limits cancellation to one instrument. Accepts continuous (ES1!), NT8 (ES 09-26), or Tradovate (ESU6) forms. |
Send {} to cancel every working order on the account.
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/orders/cancel"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {
# "instrument": "ES1!"
}
try:
response = requests.post(url, headers=headers, json=data)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
const token = 'my-secret-token';
const url = "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/orders/cancel";
const data = {
// instrument: "ES1!"
};
fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X POST "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/orders/cancel" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
Response
The response is the response envelope with api set to cancel_orders_scoped. Its response reports the cancellation count, cancelled order ids, and per-order results.
{
"success": true,
"destination": "tradovate",
"api": "cancel_orders_scoped",
"account": "DEMO12345678",
"response": {
"cancelled": 0,
"orders": [],
"detail": "No working orders matched."
},
"durationMs": 214
}
Platform nuances
- Omitting
instrumentaffects every working order on the account. Include it to avoid touching orders on other contracts. - Successfully cancelled copied leader orders are replayed to mapped follower orders.
- Partial cancellation failures are surfaced rather than reported as a clean sweep.
- Account Manager locks apply. On failure, the response envelope has
success: falseand anerrormessage.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.