analyze_risk
Assess portfolio risk exposure by calculating VaR, CVaR, volatility, beta, and maximum drawdown.
Instructions
Calculate core risk metrics for a portfolio — Value at Risk (VaR), Conditional VaR (CVaR), volatility, beta, and max drawdown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positions | Yes | Array of portfolio positions. Each entry needs a ticker and quantity. Free tier: max 20 positions. Paid tier: up to 500. | |
| confidence_level | No | VaR confidence level as a decimal, e.g. 0.95 = 95%. Range: 0.01-0.99. Default: 0.95. | |
| horizon_days | No | Risk horizon in trading days. 1 = overnight, 21 ≈ 1 month, 252 ≈ 1 year. Default: 1. | |
| method | No | VaR calculation method. "historical" uses empirical return distribution, "parametric" assumes normality, "cornish_fisher" adjusts for skew and kurtosis. Default: "historical". | historical |
| benchmark | No | Benchmark ticker for beta calculation, e.g. SPY or QQQ. Default: SPY. | SPY |
| lookback_days | No | Number of historical trading days to use. 252 ≈ 1 year, 756 ≈ 3 years. Range: 30-1260. Default: 252. |