Get Portfolio Risk
get_portfolio_riskCompute portfolio-wide risk metrics: margin utilisation, concentration by symbol, unrealised P&L, and overall risk level to assess exposure and guide decisions.
Instructions
Compute portfolio-wide risk metrics: margin utilisation, concentration by symbol, unrealised P&L, and an overall risk level.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warnings | No | Risk warnings. | |
| riskLevel | Yes | Overall risk level: low | medium | high | critical. | |
| buyingPower | Yes | Available buying power. | |
| initialMargin | Yes | Current initial margin requirement. | |
| positionCount | Yes | Number of open positions. | |
| netLiquidation | Yes | Net liquidation value. | |
| totalRealisedPnl | Yes | Total realised P&L across positions. | |
| maintenanceMargin | Yes | Current maintenance margin requirement. | |
| buyingPowerUsedPct | No | Approximate % of cash already committed. | |
| largestPositionPct | No | Concentration % of the largest position. | |
| totalUnrealisedPnl | Yes | Total unrealised P&L across positions. | |
| marginUtilisationPct | No | Maintenance margin as % of net liquidation. | |
| concentrationBySymbol | No | Map of symbol → % of net liquidation by absolute market value. | |
| largestPositionSymbol | No | Symbol of the largest position. |