PUT Change Order
- NT8
- Tradovate
Change an existing order by ID NT8
One or all of the following fields in an order can be modified: limit price, stop price, and quantity. You can optionally set a specific strategy ID to ensure the order and strategy match.
Endpoint
PUT /v1/api/accounts/{account}/orders/{orderId}/change
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Name of account in NT8 |
orderId | string | Required | ID of the order to by replaced |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
quantity | int | Optional | Contract quantity of new order |
limitPrice | float | Optional | Limit price when changing limit order type |
stopPrice | float | Optional | Stop price when changing stop order type |
strategyId | string | Optional | ATM strategy ID, forces matching of both order ID and strategy ID |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/64e8164f337c4bcfb2abc3468ff5fa20/change"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {
"quantity": 2,
# "limitPrice": 6000
# "stopPrice": 0,
# "strategyId": "MyAtmStrategy"
}
try:
response = requests.put(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/64e8164f337c4bcfb2abc3468ff5fa20/change";
const data = {
quantity: 2
// limitPrice: 6000,
// stopPrice: 0,
// strategyId: "MyAtmStrategy"
};
fetch(url, {
method: "PUT",
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 PUT "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/64e8164f337c4bcfb2abc3468ff5fa20/change" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"quantity": 2
}'
Response
- 200
- 400
- 401
- 403
- 408
- 429
- 500
{
"orderId": "36f59a2f4594436084484b92350ca25a",
"success": true
}
{
"error": "Order 'example-order' is in a terminal state"
}
{
"error": "Invalid bearer token"
}
{
"error": "Endpoint not available"
}
{
"error": "Client not ready to receive requests, disconnected."
}
// retryAfter is integer seconds; also sent as Retry-After.
{
"error": "Rate limit exceeded",
"retryAfter": 1
}
{
"success": false,
"error": "internal_error"
}
Success field types
| Field | Type | Description |
|---|---|---|
success | boolean | Change request accepted. |
orderId | string | Current order ID. |
Platform nuances
- Only nonterminal orders can be changed. A terminal order returns an error.
limitPriceis applied only to limit and stop-limit orders.stopPriceis applied only to stop-market and stop-limit orders. A newquantityis applied only when it is greater than zero.- When
strategyIdis provided, the add-on first limits the lookup to orders owned by that strategy.
WebSocket API
This request can also be made over the WebSocket API. The account and orderId path parameters and request body fields are all passed inside args.
{
"action": "rpc",
"id": "my-request-id",
"api": "Change",
"args": {
"account": "Sim101",
"orderId": "492281fc515e431692da57d957cfebb6",
"quantity": 2,
"limitPrice": 5400.00
}
}
Change an existing order by ID Tradovate
Changes the quantity, limit price, or stop price of a working Tradovate order in place. No NinjaTrader add-on is involved. Changes are partial, and the shared dispatcher restores broker-required live fields that were omitted.
Endpoint
PUT /v1/api/tv/accounts/{account}/orders/{id}/change
POST on the same path remains accepted as a backward-compatibility alias.
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. |
id | string | Required | Tradovate order id or an orderId assigned on an earlier place call. |
Body parameters
Send only the fields that should change.
| Name | Type | Required | Description |
|---|---|---|---|
qty | int | Optional | New contract quantity. |
orderType | string | Optional | New order type, including native trailing variants. |
limitPrice | number | Optional | New limit price. |
stopPrice | number | Optional | New stop price. |
tif | string | Optional | New time in force. |
text | string | Optional | New free-form order note. Truncated to 64 characters (Tradovate's limit). |
expireTime | string | Optional | ISO-8601 expiry; required when changing to gtd. |
maxShow | int | Optional | Native iceberg display quantity. |
trailOffset | number | Optional | Native trailing-stop distance. |
pegDifference | number | Optional | Alias of trailOffset. |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/orders/123456789/change"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {
"limitPrice": 5400.00
}
try:
response = requests.put(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/123456789/change";
const data = {
limitPrice: 5400.00
};
fetch(url, {
method: "PUT",
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 PUT "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/orders/123456789/change" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"limitPrice": 5400.00}'
Response
The response is the response envelope with api set to modify_order. response is Tradovate's acknowledgement of the modify command, identified by commandId. It does not echo the new values.
- 200
- 400
- 401
- 403
- 429
- 500
- 502
- 503
{
"success": true,
"destination": "tradovate",
"api": "modify_order",
"account": "DEMO12345678",
"instrument": null,
"response": { "commandId": 123456795 },
"durationMs": 214
}
{
"error": "Invalid request"
}
{
"success": false,
"error": "inactive_subscription"
}
{
"success": false,
"error": "tradovate_not_linked"
}
// retryAfter is integer seconds; also sent as Retry-After.
{
"success": false,
"error": "rate_limited",
"detail": "CrossTrade API rate limit exceeded (180 requests/min per user). Retry after 1s.",
"retryAfter": 1
}
{
"success": false,
"error": "internal_error"
}
{
"success": false,
"error": "tradovate_unavailable",
"detail": "Tradovate is temporarily unavailable. Please try again shortly."
}
{
"success": false,
"error": "temporarily_disabled"
}
Success field types
| Field | Type | Description |
|---|---|---|
success | boolean | Modify command accepted. |
destination, api, account | string | Dispatcher and account identity. |
instrument | null in captures | Modification is addressed by order ID. |
durationMs | integer | Command duration in milliseconds. |
response | object | Broker acknowledgement. |
response.commandId | integer | Modify-command ID. |
A success means Tradovate accepted the modify command, not that the change took effect: Tradovate can still reject it afterward. To confirm, read the order lifecycle, find the entry in reports whose commandId matches, and check that it carries no rejectReason. Do not treat the lifecycle's version fields alone as confirmation, because the latest version can belong to a modification Tradovate then rejected.
Platform nuances
PUTis canonical. ThePOSTalias exists only for backward compatibility.- Tradovate uses
{id}in the path where NT8 uses{orderId}. The body fields use the same camelCase keys as the NT8 surface. - The dispatcher restores omitted quantity, order type, the limit or stop price required by the final order type, and the trailing offset required by trailing orders from the current live order version.
- Copied followers restore omitted fields from each follower's own live order version before modification.
- Account Manager locks and Trade Copier fan-out apply. On failure, the response is
{"success": false, "error": "<message>"}.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.