Skip to main content

GET Performance

Get session performance NT8​

Returns session performance across NinjaTrader accounts through the connected CrossTrade add-on.

Endpoint​

GET /v1/api/performance

Headers​

NameValue
AuthorizationBearer <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​

import requests

response = requests.get(
'https://app.crosstrade.io/v1/api/performance',
headers={'Authorization': 'Bearer my-secret-token'},
)
print(response.status_code, response.json())

Response​

// 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
}

Success field types​

Float fields accept whole or fractional JSON numbers. Fields in the account-row table are relative to accounts[].

FieldTypeDescription
successbooleanRequest outcome.
epoch, sessionStartintegerSnapshot and session-start times in Unix milliseconds.
accountsarray of objectsPer-account performance.
accounts[].accountIdintegerNT8 account ID.
accounts[].namestringAccount name.
accounts[].isConnected, accounts[].isCleanSessionbooleanConnection and session flags.
accounts[].accountobjectNT8 account field grid, without root success. commissionTemplate was not present in this route's captures.
accounts[].managementobjectCommission-aware management figures below.
accounts[].management.realizedProfitWithCommission, accounts[].management.realizedProfitNoCommissionfloatRealized P/L with and without commission.
accounts[].management.unrealizedProfitWithCommission, accounts[].management.unrealizedProfitNoCommissionfloatUnrealized P/L with and without commission.
accounts[].management.realizedCommission, accounts[].management.unrealizedCommissionfloatCommission amounts.
accounts[].positionsSessionStartarrayOnly empty arrays captured; populated item types remain unverified.
Account-row fieldTypeDescription
unrealizedProfitLoss, grossProfit, grossLoss, netProfit, netLiquidationfloatP/L and valuation figures.
openPositions, maxConsecutiveLoser, maxConsecutiveWinner, totalQuantity, tradesCountintegerPosition, streak, quantity and trade counts.
averageBarsInTrade, averageEntryEfficiency, averageExitEfficiency, averageTotalEfficiencyfloatTrade duration and efficiency metrics.
averageTimeInMarket, longestFlatPeriod, maxTimeToRecoverstringFormatted durations.
averageTimeInMarketSerializable, longestFlatPeriodSerializable, maxTimeToRecoverSerializableintegerSerialized duration values.
minDate, maxDatestringPerformance date bounds; may be sentinel dates when no trades exist.
monthlyStdDev, monthlyUlcer, probability, profitFactor, riskFreeReturn, rSquared, sharpeRatio, sortinoRatiofloatStatistical metrics reported by NT8.
totalCommission, totalSlippage, tradesPerDayfloatCosts, slippage and trade frequency.
needsUpdatebooleanPerformance update flag.
currency, percentobjectMetric groups. Both have the fields below.
Field within currency or percentType
averageEtd, averageMae, averageMfe, averageProfitfloat
cumProfit, drawdown, largestLoser, largestWinnerfloat
profitPerMonth, stdDev, turnaround, ulcerfloat

WebSocket API​

{
"action": "rpc",
"id": "performance-request",
"api": "SessionPerformance",
"args": {}
}