compare_portfolios
Compare 2 to 4 portfolios (built-in model portfolios, canonical strategies or your own allocations) side by side over their COMMON window, which is the only fair comparison: two pages' headline numbers usually cover different periods (a portfolio holding gold starts in 2004, the Ivy portfolio in 1996). Returns CAGR, volatility, max drawdown, Sharpe, Sortino, Ulcer index, best/worst year and longest time underwater on the aligned months, each portfolio's own full-window figures (labelled with their start), the pairwise correlation of their monthly returns and a calendar-year table. Use it for 'All Weather vs Golden Butterfly vs 60/40', 'which of these held up better', 'my portfolio vs 60/40'. Each item in portfolios has exactly one of template or strategy (ids from list_portfolios) or assets (your own allocation, including nested portfolios, rotations and strategies as holdings, with optional rebalance and overlay), plus an optional label. Ids are precomputed from the monthly refresh; assets entries are computed live (at most 2 custom entries and 24 distinct tickers per call). Read-only. For one portfolio's detail use analyze_portfolio, portfolio_returns or portfolio_risk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| years | No | Calendar-year rows to include (most recent N years of the common window; 0 = none). Default 10. | |
| portfolios | Yes | 2 to 4 portfolios to compare, e.g. [{"template":"all-weather"},{"template":"golden-butterfly"},{"template":"classic-60-40","label":"60/40"}]. |