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
{
"positions": [
{
"type": "NinjaTrader.Cbi.Position",
"account": "Sim101",
"instrument": "MES 09-26",
"instrumentType": "Future",
"marketPosition": "Long",
"quantity": 7,
"averagePrice": 6615.178571428572,
"marketPrice": 6614.25,
"unrealizedProfitLoss": -32.50000000000455,
"tag": null
},
{
"type": "NinjaTrader.Cbi.Position",
"account": "Sim101",
"instrument": "NQ 09-26",
"instrumentType": "Future",
"marketPosition": "Short",
"quantity": 1,
"averagePrice": 24605.25,
"marketPrice": 24606.25,
"unrealizedProfitLoss": -20.0,
"tag": null
}
],
"count": 2,
"success": true
}
{
"error": "Invalid request"
}
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.
{
"success": true,
"data": [
{
"environment": "demo",
"userId": "...",
"name": "...",
"data": []
}
]
}
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.