GET All Positions
- NT8
- Tradovate
Get all positions NT8
Retrieve positions across all accounts in a single request.
Endpoint
GET /v1/api/positions
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
includeFlat | boolean | Optional | Include flat (zero-quantity) positions. Default: false |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/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/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/positions" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
Response
- 200
- 400
- 401
- 403
- 408
- 429
- 500
{
"positions": [
{
"type": "NinjaTrader.Cbi.Position",
"account": "Sim101",
"instrument": "MES 12-26",
"instrumentType": "Future",
"marketPosition": "Long",
"quantity": 7,
"averagePrice": 6615.178571428572,
"marketPrice": 6614.25,
"unrealizedProfitLoss": -32.50000000000455,
"tag": null
}
],
"count": 1,
"success": true
}
{
"error": "The request timed out, please check connection to NT8 Add-On."
}
{
"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 | true on success. |
count | integer | Returned position count. |
positions | array of objects | May be empty. |
positions[].type, positions[].account, positions[].instrument, positions[].instrumentType | string | Position identity. |
positions[].marketPosition | string | Long, Short, or Flat. |
positions[].quantity | integer | Position size. |
positions[].averagePrice, positions[].marketPrice, positions[].unrealizedProfitLoss | float | Entry price, market price and currency P/L. |
positions[].tag | string or null | Associated tag. |
Platform nuances
By default, flat positions are excluded. Pass ?includeFlat=true to include them. The response
returns the total number of rows in count alongside the positions collection.
WebSocket API
This request can also be made over the WebSocket API. Query parameters are passed inside args.
{
"action": "rpc",
"id": "my-request-id",
"api": "GetAllPositions",
"args": {
"includeFlat": false
}
}
Get all positions Tradovate
Lists Tradovate position rows across every linked identity. The request executes server-side against the Tradovate Web API and works while NinjaTrader is closed.
Endpoint
GET /v1/api/tv/positions
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Query parameters
This endpoint has no query parameters. The NT8-only includeFlat parameter is not supported.
Each linked identity returns its Tradovate position-list result inside an identity envelope.
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/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/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/positions" \
-H "Authorization: Bearer $TOKEN"
Response
Successful reads return {"success": true, "data": ...}. For this endpoint, data is a list
of identity envelopes. Each envelope contains environment, userId, name, and data; the
nested data field contains that identity's Tradovate position-list result.
- 200
- 401
- 403
- 429
- 500
- 502
- 503
{
"success": true,
"data": [
{
"environment": "demo",
"userId": "12345",
"name": "Demo identity",
"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": "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 can be omitted when not applicable, particularly netPrice on flat rows.
| Field | Type | Description |
|---|---|---|
success | boolean | Outer read succeeded; check each identity too. |
data | array of objects | Identity envelopes. |
data[].environment, data[].userId, data[].name | string | Environment, identity ID and display name. |
data[].data | array of objects or object | Position rows, or an error object. |
data[].data.error | string | Per-identity read failure. |
data[].data[].id, data[].data[].accountId, data[].data[].contractId | integer | Broker identifiers. |
data[].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[].data[].timestamp | string | ISO 8601 timestamp. |
data[].data[].tradeDate | object | Trade-date components. |
data[].data[].tradeDate.year, data[].data[].tradeDate.month, data[].data[].tradeDate.day | integer | Calendar date. |
data[].data[].netPos, data[].data[].prevPos, data[].data[].bought, data[].data[].sold | integer | Signed net position and quantity counters. |
data[].data[].netPrice, data[].data[].boughtValue, data[].data[].soldValue | float | Net price and accumulated values. |
data[].data[].archived, data[].data[].isActiveOrPendingSettlement | boolean | Broker position flags. |
Platform nuances
- The result spans all linked Tradovate identities, not NT8 accounts connected through an add-on.
- The top-level
datalist contains one identity envelope per linked Tradovate identity rather than one flattened array of positions. - There is no
includeFlatequivalent on this endpoint.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.