GET Performance
- NT8
- Tradovate
Get session performance NT8
Returns session performance across NinjaTrader accounts through the connected CrossTrade add-on.
Endpoint
GET /v1/api/performance
Headers
| Name | Value |
|---|---|
| Authorization | Bearer <token> |
Query parameters
No parameters are required. The HTTP route also forwards optional startTime and explain query values to the add-on's SessionPerformance method. The response below documents the default request; an explanation-enabled response has not been captured.
Code examples
- Python
- JavaScript
- cURL
import requests
response = requests.get(
'https://app.crosstrade.io/v1/api/performance',
headers={'Authorization': 'Bearer my-secret-token'},
)
print(response.status_code, response.json())
const response = await fetch('https://app.crosstrade.io/v1/api/performance', {
headers: {Authorization: 'Bearer my-secret-token'},
});
console.log(response.status, await response.json());
curl 'https://app.crosstrade.io/v1/api/performance' \
-H 'Authorization: Bearer my-secret-token'
Response
- 200
- 400
- 401
- 403
- 408
- 429
- 500
// One account shown. Nested account values are abbreviated; full grid linked below.
{
"epoch": 1793121923467,
"sessionStart": 1793052000000,
"accounts": [
{
"accountId": 2,
"name": "Sim101",
"isConnected": true,
"isCleanSession": true,
"management": {
"realizedProfitWithCommission": 0,
"realizedProfitNoCommission": 0,
"unrealizedProfitWithCommission": 0,
"unrealizedProfitNoCommission": 0,
"realizedCommission": 0,
"unrealizedCommission": 0
},
"account": {
"id": 2,
"name": "Sim101",
"type": "NinjaTrader.Cbi.Account",
"connectionStatus": "Connected",
"item": {
"cashValue": 100000,
"realizedProfitLoss": 0,
"unrealizedProfitLoss": 0
}
},
"unrealizedProfitLoss": 0,
"openPositions": 0,
"grossProfit": 0,
"grossLoss": 0,
"netProfit": 0,
"netLiquidation": 100000,
"averageBarsInTrade": 0,
"averageEntryEfficiency": 1,
"averageExitEfficiency": 1,
"averageTimeInMarket": "00:00:00",
"averageTimeInMarketSerializable": 0,
"averageTotalEfficiency": 1,
"longestFlatPeriod": "00:00:00",
"longestFlatPeriodSerializable": 0,
"maxConsecutiveLoser": 0,
"maxConsecutiveWinner": 0,
"maxDate": "2099-12-01T00:00:00",
"maxTimeToRecover": "00:00:00",
"maxTimeToRecoverSerializable": 0,
"minDate": "1800-01-01T00:00:00",
"monthlyStdDev": 0,
"monthlyUlcer": 0,
"needsUpdate": false,
"probability": 0,
"profitFactor": 1,
"riskFreeReturn": 0,
"rSquared": 0,
"sharpeRatio": 1,
"sortinoRatio": 1,
"totalCommission": 0,
"totalQuantity": 0,
"totalSlippage": 0,
"tradesCount": 0,
"tradesPerDay": 0,
"currency": {
"averageEtd": 0,
"averageMae": 0,
"averageMfe": 0,
"averageProfit": 0,
"cumProfit": 0,
"drawdown": 0,
"largestLoser": 0,
"largestWinner": 0,
"profitPerMonth": 0,
"stdDev": 0,
"turnaround": 0,
"ulcer": 0
},
"percent": {
"averageEtd": 0,
"averageMae": 0,
"averageMfe": 0,
"averageProfit": 0,
"cumProfit": 0,
"drawdown": 0,
"largestLoser": 0,
"largestWinner": 0,
"profitPerMonth": 0,
"stdDev": 0,
"turnaround": 0,
"ulcer": 0
},
"positionsSessionStart": []
}
],
"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
Float fields accept whole or fractional JSON numbers. Fields in the account-row table are relative to accounts[].
| Field | Type | Description |
|---|---|---|
success | boolean | Request outcome. |
epoch, sessionStart | integer | Snapshot and session-start times in Unix milliseconds. |
accounts | array of objects | Per-account performance. |
accounts[].accountId | integer | NT8 account ID. |
accounts[].name | string | Account name. |
accounts[].isConnected, accounts[].isCleanSession | boolean | Connection and session flags. |
accounts[].account | object | NT8 account field grid, without root success. commissionTemplate was not present in this route's captures. |
accounts[].management | object | Commission-aware management figures below. |
accounts[].management.realizedProfitWithCommission, accounts[].management.realizedProfitNoCommission | float | Realized P/L with and without commission. |
accounts[].management.unrealizedProfitWithCommission, accounts[].management.unrealizedProfitNoCommission | float | Unrealized P/L with and without commission. |
accounts[].management.realizedCommission, accounts[].management.unrealizedCommission | float | Commission amounts. |
accounts[].positionsSessionStart | array | Only empty arrays captured; populated item types remain unverified. |
| Account-row field | Type | Description |
|---|---|---|
unrealizedProfitLoss, grossProfit, grossLoss, netProfit, netLiquidation | float | P/L and valuation figures. |
openPositions, maxConsecutiveLoser, maxConsecutiveWinner, totalQuantity, tradesCount | integer | Position, streak, quantity and trade counts. |
averageBarsInTrade, averageEntryEfficiency, averageExitEfficiency, averageTotalEfficiency | float | Trade duration and efficiency metrics. |
averageTimeInMarket, longestFlatPeriod, maxTimeToRecover | string | Formatted durations. |
averageTimeInMarketSerializable, longestFlatPeriodSerializable, maxTimeToRecoverSerializable | integer | Serialized duration values. |
minDate, maxDate | string | Performance date bounds; may be sentinel dates when no trades exist. |
monthlyStdDev, monthlyUlcer, probability, profitFactor, riskFreeReturn, rSquared, sharpeRatio, sortinoRatio | float | Statistical metrics reported by NT8. |
totalCommission, totalSlippage, tradesPerDay | float | Costs, slippage and trade frequency. |
needsUpdate | boolean | Performance update flag. |
currency, percent | object | Metric groups. Both have the fields below. |
Field within currency or percent | Type |
|---|---|
averageEtd, averageMae, averageMfe, averageProfit | float |
cumProfit, drawdown, largestLoser, largestWinner | float |
profitPerMonth, stdDev, turnaround, ulcer | float |
WebSocket API
{
"action": "rpc",
"id": "performance-request",
"api": "SessionPerformance",
"args": {}
}
Tradovate
There is no equivalent /v1/api/tv/performance endpoint. Use Accounts Summary for current account values and Fill History for stored fills.