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
{
"orderId": "36f59a2f4594436084484b92350ca25a",
"success": true
}
{
"error": "Invalid request"
}
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.
{
"success": true,
"destination": "tradovate",
"api": "modify_order",
"account": "DEMO12345678",
"response": {},
"durationMs": 214
}
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.