GET Positions
- NT8
- Tradovate
Get list of all positions in one account NT8
Lists the positions in one NinjaTrader account's current position collection. The
account lookup is case-insensitive. This endpoint does not explicitly remove flat
positions: check marketPosition and quantity before treating a row as open.
Endpoint
GET /v1/api/accounts/{account}/positions
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Name of account in NT8 |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/accounts/Sim101/positions"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
try:
response = requests.get(url, headers=headers)
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/positions";
fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
}
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X GET "https://app.crosstrade.io/v1/api/accounts/Sim101/positions" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
Response
- 200
- 400
- 401
- 403
- 408
- 429
- 500
- 502
// positions may be []; tag is null when untagged.
{
"positions": [
{
"type": "NinjaTrader.Cbi.Position",
"account": "Sim101",
"instrument": "ES 12-26",
"instrumentType": "Future",
"marketPosition": "Long",
"quantity": 2,
"averagePrice": 6000.25,
"marketPrice": 6001.5,
"unrealizedProfitLoss": 125.0,
"tag": null
}
],
"success": true
}
// Also used for add-on errors and timeouts. Some errors include success: false.
{
"error": "Account 'DemoAccount' not found"
}
// Also returned for an inactive subscription or a plan without API access.
{
"error": "Invalid bearer token"
}
// Endpoint availability check.
{
"error": "Endpoint not available"
}
// Reconnect the CrossTrade add-on in NinjaTrader before retrying.
{
"error": "Client not ready to receive requests, disconnected."
}
// retryAfter: integer seconds; also sent in the Retry-After header.
// Data-transfer limits use a different error and omit both retry fields.
{
"error": "Rate limit exceeded",
"retryAfter": 1
}
{
"success": false,
"error": "internal_error"
}
// Only when response validation is enabled (disabled by default).
{
"success": false,
"error": "invalid_upstream_response"
}
Success field types
All fields are required. Only tag is nullable. Float fields accept whole or fractional JSON numbers.
| Field | Type | Description |
|---|---|---|
success | boolean | true on success. |
positions | array of objects | Account's position collection; may be empty. |
positions[].type | string | Normally NinjaTrader.Cbi.Position. |
positions[].account | string | Account name reported by NT8. |
positions[].instrument | string | Full instrument name, including the futures contract month. |
positions[].instrumentType | string | Instrument category, such as Future. |
positions[].marketPosition | string | Long, Short, or Flat. |
positions[].quantity | integer | Position size; side is given by marketPosition. |
positions[].averagePrice | float | Average entry price. |
positions[].marketPrice | float | Market price at the snapshot. |
positions[].unrealizedProfitLoss | float | Unrealized P/L in currency units. |
positions[].tag | string or null | Associated tag, or null when untagged. |
Platform nuances
NT8 returns the position collection in positions. Each position uses marketPosition for its
side and includes the current unrealizedProfitLoss. This account-specific route
does not support an includeFlat query parameter and does not explicitly filter
flat entries from NT8's collection.
WebSocket API
This request can also be made over the WebSocket API. The account path parameter is passed inside args.
{
"action": "rpc",
"id": "my-request-id",
"api": "ListPositions",
"args": {
"account": "Sim101"
}
}
Get list of all positions in one account Tradovate
Lists the fill-reconciled open positions for one linked Tradovate account. The request executes server-side against the Tradovate Web API and works while NinjaTrader is closed.
Endpoint
GET /v1/api/tv/accounts/{account}/positions
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Tradovate account name, such as DEMO12345678 |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/positions"
headers = {
"Authorization": f"Bearer {token}"
}
try:
response = requests.get(url, headers=headers)
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/positions";
fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`
}
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X GET "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678/positions" \
-H "Authorization: Bearer $TOKEN"
Response
- 200
- 400
- 401
- 403
- 429
- 500
- 502
- 503
{
"success": true,
"data": [
{
"id": 123456789,
"accountId": 12345678,
"contractId": 1234,
"instrument": "MESZ6",
"timestamp": "2026-10-27T12:00:00Z",
"tradeDate": {
"year": 2026,
"month": 10,
"day": 27
},
"netPos": 1,
"netPrice": 6000.25,
"bought": 1,
"boughtValue": 6000.25,
"sold": 0,
"soldValue": 0,
"archived": false,
"prevPos": 0,
"isActiveOrPendingSettlement": true
}
]
}
{
"success": false,
"error": "unknown_account"
}
{
"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
Broker fields may be omitted when not applicable. Float fields accept whole or fractional numbers.
| Field | Type | Description |
|---|---|---|
success | boolean | true on success. |
data | array of objects | Fill-reconciled positions; may be empty. |
data[].id, data[].accountId, data[].contractId | integer | Broker identifiers. |
data[].instrument | string | Contract symbol resolved from contractId, for example MESZ6. Briefly the id as a string if the name cannot be resolved yet. |
data[].timestamp | string | ISO 8601 timestamp. |
data[].tradeDate | object | Session trade date. |
data[].tradeDate.year, data[].tradeDate.month, data[].tradeDate.day | integer | Calendar date components. |
data[].netPos, data[].prevPos | integer | Current and previous signed net quantities. |
data[].bought, data[].sold | integer | Bought and sold quantities. |
data[].netPrice, data[].prevPrice, data[].boughtValue, data[].soldValue | float | Current/previous price and accumulated values; prevPrice is optional. |
data[].archived, data[].isActiveOrPendingSettlement | boolean | Broker position flags. |
Platform nuances
{account}identifies a Tradovate account rather than an NT8 account.- The positions are fill-reconciled and returned in
data, not the NT8positionsfield. - The endpoint works while NinjaTrader is closed.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.