Skip to main content

GET Account

Get a specific account by name NT8​

Returns current details and balance information for one named NinjaTrader account.

Endpoint​

GET /v1/api/accounts/{account}

Headers​

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Path parameters​

NameTypeRequiredDescription
accountstringRequiredName of account in NT8

Code examples​

import requests

token = 'my-secret-token'

url = "https://app.crosstrade.io/v1/api/accounts/Sim101"
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}")

Response​

{
"id": 2,
"name": "Sim101",
"type": "NinjaTrader.Cbi.Account",
"displayName": "Sim101",
"primaryUser": null,
"provider": "Simulator",
"denomination": "UsDollar",
"commissionTemplate": null,
"status": "Enabled",
"isAccountFlat": false,
"dailyLossLimit": 0.0,
"minCashValue": 0.0,
"maxOrderSize": 0,
"maxPositionSize": 0,
"connection": "NinjaTrader.Cbi.Connection",
"connectionStatus": "Connected",
"connectionName": "Simulation",
"item": {
"buyingPower": 0.0,
"cashValue": 100565.00000000285,
"commission": 0.0,
"dailyLossLimit": 0.0,
"dailyProfitTrigger": 0.0,
"excessInitialMargin": 103502.50000000285,
"excessIntradayMargin": 103502.50000000285,
"excessMaintenanceMargin": 100000.0,
"excessPositionMargin": 100000.0,
"fee": 0.0,
"grossRealizedProfitLoss": 0.0,
"initialMargin": 0.0,
"intradayMargin": 0.0,
"longOptionValue": 0.0,
"longStockValue": 0.0,
"lookAheadMaintenanceMargin": 0.0,
"maintenanceMargin": 0.0,
"netLiquidation": 103502.50000000285,
"netLiquidationByCurrency": 0.0,
"positionMargin": 0.0,
"realizedProfitLoss": 0.0,
"shortOptionValue": 0.0,
"shortStockValue": 0.0,
"sodCashValue": 0.0,
"sodLiquidatingValue": 0.0,
"totalCashBalance": 0.0,
"trailingMaxDrawdown": 0.0,
"unrealizedProfitLoss": 2937.5,
"weeklyLossLimit": 0.0,
"weeklyProfitLoss": 0.0,
"weeklyProfitTrigger": 0.0
},
"success": true
}

Success field types​

Float fields accept whole or fractional JSON numbers. Account-item values can be null when NT8 cannot read them.

FieldTypeDescription
successbooleantrue on success.
idintegerNT8 account ID.
name, displayName, type, provider, denomination, statusstringAccount identity, provider, currency and status.
primaryUsernull in capturesNo populated primary-user value captured.
commissionTemplate, connection, connectionNamestring or nullCommission template and connection metadata.
connectionStatusstringBroker connection status.
isAccountFlatbooleanWhether the account is flat.
dailyLossLimit, minCashValuefloatAccount limits.
maxOrderSize, maxPositionSizeintegerQuantity limits.
itemobjectAccount values below, each float or null.
item.buyingPower, item.cashValue, item.commission, item.feefloat or nullAvailable funds and costs.
item.dailyLossLimit, item.dailyProfitTrigger, item.trailingMaxDrawdownfloat or nullDaily risk limits.
item.excessInitialMargin, item.excessIntradayMargin, item.excessMaintenanceMargin, item.excessPositionMarginfloat or nullExcess margin values.
item.initialMargin, item.intradayMargin, item.lookAheadMaintenanceMargin, item.maintenanceMargin, item.positionMarginfloat or nullMargin requirements.
item.grossRealizedProfitLoss, item.realizedProfitLoss, item.unrealizedProfitLossfloat or nullP/L in currency units.
item.longOptionValue, item.longStockValue, item.shortOptionValue, item.shortStockValuefloat or nullHoldings valuations.
item.netLiquidation, item.netLiquidationByCurrency, item.totalCashBalancefloat or nullAccount valuations.
item.sodCashValue, item.sodLiquidatingValuefloat or nullStart-of-day valuations.
item.weeklyLossLimit, item.weeklyProfitLoss, item.weeklyProfitTriggerfloat or nullWeekly P/L and limits.

Platform nuances​

NT8 account fields are returned at the top level. Current balance and margin values are nested under item.

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": "GetAccount",
"args": {
"account": "Sim101"
}
}