# MarketHeist Backtest

> Backtest and analyze any portfolio, incl. nested multi-strategy ones: returns, risk, factors, guides

- name: io.marketheist/backtest
- version: 1.3.0
- connection class: R0 (autonomous)
- trust: 79/100 flags: no-repository
- quality: 81/100 (good)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/io.marketheist%2Fbacktest
- tools: https://api.protogrid.dev/v1/servers/io.marketheist%2Fbacktest/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "backtest": {
      "type": "http",
      "url": "https://api.marketheist.io/api/mcp"
    }
  }
}
```


## Trust

- hygiene: 80
- liveness: 99
- freshness: 100
- provenance: 45
- drivers: +dns-namespace +reachable +uptime-97% +updated-2d-ago -no-repository
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 81/100 (good)

### protocol: 75 (weight 25)

- warn `protocol.modern`: newest supported version is 2025-11-25; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
- n/a `protocol.stateless`: only applies to 2026-07-28 servers
- pass `protocol.transport`: streamable HTTP
- n/a `protocol.list_ttl`: only applies to 2026-07-28 servers

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 86 (weight 30)

- pass `tools.descriptions`: every tool has a description
- warn `tools.description_length`: 8 tools have descriptions over 1,024 characters, which crowds the context
- pass `tools.schemas`: every tool has an object input schema
- pass `tools.annotations`: 10 of 10 tools declare readOnlyHint or destructiveHint
- pass `tools.directory_hints`: every tool declares readOnlyHint, destructiveHint, idempotentHint and openWorldHint
- warn `tools.token_cost`: about 8,669 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump

### stability: n/a (weight 15)

- n/a `stability.changes`, `stability.rug_pull`: tool history recorded for 5 of the 7 days needed

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 10, about 8,669 tokens to load them all
- tool set hash: f51f840dd01c1a45fb1a004982e85477
- tools last changed: 2026-10-18T17:45:13.439Z
- badge: [![protogrid quality](https://protogrid.dev/badge/io.marketheist/backtest.svg)](https://protogrid.dev/servers/io.marketheist/backtest)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Tool changes

- 2026-10-18 `decompose_factors` changed (description, inputSchema)
  - before: Explain WHAT DRIVES the returns of a ticker, ETF or built-in portfolio by decomposing them into common factor exposures (market, size, value, momentum, quality, low-volatility, duration, credit) plus an idiosyncratic residual. Use this when the user asks why two assets move together, what a fund is really exposed to, whether a stock is a growth or value tilt, how much of a return is just market beta, whether it has real alpha, or what is driving a portfolio's returns. Returns betas (loadings), t-stats, an additive variance decomposition (shares sum to R²), annualized alpha, idiosyncratic vs total volatility, and for a portfolio the holdings that drive each factor. Computed by OLS regression on real price history via tradeable ETF proxies (long-short factor spreads): measured exposure, not a forecast. Provide exactly one of `target` (a ticker, computed live), `template` (a built-in model portfolio) or `strategy` (a canonical strategy); portfolio ids are answered from precomputed monthly data through the stated month with the five default factors (market, size, value, duration, credit) and ignore `frequency` and `factors`. For performance numbers use analyze_portfolio. Read-only.
  - after: Explain WHAT DRIVES the returns of a ticker, ETF or built-in portfolio by decomposing them into common factor exposures (market, size, value, momentum, quality, low-volatility, duration, credit) plus an idiosyncratic residual. Use this when the user asks why two assets move together, what a fund is really exposed to, whether a stock is a growth or value tilt, how much of a return is just market beta, whether it has real alpha, or what is driving a portfolio's returns. Returns betas (loadings), t-stats, an additive variance decomposition (shares sum to R²), annualized alpha, idiosyncratic vs total volatility, and for a portfolio the holdings that drive each factor. Computed by OLS regression on real price history via tradeable ETF proxies (long-short factor spreads): measured exposure, not a forecast. Provide exactly one of `target` (a ticker, computed live), `template` (a built-in model portfolio), `strategy` (a canonical strategy) or `assets` (your own allocation, including nested portfolios, rotations and strategies as holdings, computed live); portfolio ids are answered from precomputed monthly data through the stated month. Portfolios (ids and `assets`) use the five default factors (market, size, value, duration, credit), are monthly and ignore `frequency` and `factors`. For performance numbers use analyze_portfolio. Read-only.
- 2026-10-18 `analyze_portfolio` changed (inputSchema)
- 2026-10-18 `compare_portfolios` changed (description, inputSchema, annotations)
  - before: Compare 2 to 4 built-in model portfolios or canonical strategies 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'. Each item in `portfolios` has exactly one of `template` or `strategy` (ids from list_portfolios) and an optional `label`. Read-only, precomputed from the monthly refresh (data through the stated month). For one portfolio's detail use analyze_portfolio, portfolio_returns or portfolio_risk; custom allocations are not supported here.
  - after: 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.
- 2026-10-18 `portfolio_risk` changed (description, inputSchema, annotations)
  - before: Answer both 'how bad did it get' and 'is it really diversified' for a built-in model portfolio or canonical strategy. Drawdowns: the deepest peak-to-trough episodes with months to trough and recovery, Ulcer index, longest time underwater, monthly VaR/CVaR 95, worst month and year, and returns in 2008, 2020 and 2022. Diversification: each holding's share of the risk next to its share of the money (60/40 is about 60% of the money and 93% of the risk), the number of independent bets over the full window, the last 10 years and the 36 months to Feb 2009 and Dec 2022, co-movement groups, near-duplicate pairs and the equal-risk weights. Correlations: the holdings' correlation matrix. Pass exactly one of `template` (e.g. classic-60-40, all-weather) or `strategy` (e.g. faber-trend-timing); list_portfolios shows valid ids. `sections` limits the output. Read-only, precomputed from the monthly refresh (data through the stated month), instant. For headline CAGR/Sharpe use analyze_portfolio; for calendar returns use portfolio_returns; for custom allocations use analyze_portfolio.
  - after: Answer both 'how bad did it get' and 'is it really diversified' for a built-in model portfolio, a canonical strategy or your own portfolio. Drawdowns: the deepest peak-to-trough episodes with months to trough and recovery, Ulcer index, longest time underwater, monthly VaR/CVaR 95, worst month and year, and returns in 2008, 2020 and 2022. Diversification: each holding's share of the risk next to its share of the money (60/40 is about 60% of the money and 93% of the risk), the number of independent bets over the full window, the last 10 years and the 36 months to Feb 2009 and Dec 2022, co-movement groups, near-duplicate pairs and the equal-risk weights. Correlations: the holdings' correlation matrix. Pass exactly one of `template` (e.g. classic-60-40, all-weather), `strategy` (e.g. faber-trend-timing) or `assets` (your own allocation, including nested portfolios, rotations and strategies as holdings via `sleeve`, with optional `rebalance` and `overlay`); list_portfolios shows valid ids. `sections` limits the output. Ids are precomputed from the monthly refresh (instant); `assets` are computed live, with independent bets over the full window (and the last 10 years for plain tickers); the 2008 and 2022 windows are computed for built-in portfolios only. Read-only. For headline CAGR/Sharpe use analyze_portfolio; for calendar returns use portfolio_returns.
- 2026-10-18 `portfolio_returns` changed (description, inputSchema, annotations)
  - before: Look up how a built-in model portfolio, canonical strategy or fund actually returned: seasonality by calendar month (average return, share of positive months, number of years and a t-statistic so a thin 'September effect' is not presented as a law), calendar-year returns with partial years labelled (optionally next to the S&P 500), trailing 1/3/5/10/20/30-year returns, and the best and worst year and month. Use it for 'is September bad for 60/40', 'what did All Weather return in 2022', 'how has SPY done over 10 years'. Pass exactly one of `template` (e.g. all-weather, classic-60-40), `strategy` (e.g. dual-momentum-gem) or `ticker` (a fund such as SPY, VTI, TLT, GLD, BND, VXUS); list_portfolios shows every valid id. For tickers outside that set, or custom allocations, use analyze_portfolio. Read-only and precomputed from the monthly refresh (proxy-extended monthly total returns), so it is instant and always says which month the data runs through. For risk and drawdowns use portfolio_risk; to compare portfolios use compare_portfolios.
  - after: Look up how a portfolio, strategy or fund actually returned: seasonality by calendar month (average return, share of positive months, number of years and a t-statistic so a thin 'September effect' is not presented as a law), calendar-year returns with partial years labelled (optionally next to the S&P 500), trailing 1/3/5/10/20/30-year returns, and the best and worst year and month. Use it for 'is September bad for 60/40', 'what did All Weather return in 2022', 'how has SPY done over 10 years', 'what did my own portfolio return each year'. Pass exactly one of `template` (e.g. all-weather, classic-60-40), `strategy` (e.g. dual-momentum-gem), `ticker` (any Yahoo ticker) or `assets` (your own allocation, including nested portfolios, rotations and strategies as holdings via `sleeve`, with optional `rebalance` and `overlay`); list_portfolios shows every valid id. Built-in ids and the funds with a history page are precomputed from the monthly refresh (instant); other tickers and `assets` are computed live from market data (proxy-extended monthly total returns). Read-only; every answer says which month the data runs through. For risk and drawdowns use portfolio_risk; to compare portfolios use compare_portfolios.
- 2026-10-18 `list_indicators` changed (description)
  - before: List the built-in technical indicators available for backtesting (RSI, moving-average crossovers, ADX, Bollinger, CCI, Stochastic, and more) with their IDs and default parameters. Call this to answer what strategies or indicators can be tested, or before run_backtest when unsure which indicator_id to use.
  - after: List the built-in technical indicators available for backtesting (RSI, moving-average crossovers, ADX, Bollinger, CCI, Stochastic, and more) with their IDs, parameters with defaults, and each indicator's default long rule. Call this to answer what strategies or indicators can be tested, or before run_backtest when unsure which indicator_id or parameters to use. Takes no arguments. Read-only and static (no market data is fetched, never rate-limited by the live budget). To find portfolios and strategies instead, use list_portfolios.
- 2026-10-18 `run_backtest` changed (description)
  - before: Backtest a trading strategy on any Yahoo Finance ticker and get authoritative performance metrics computed from real historical price data — not estimated. Use this whenever the user asks how a strategy or indicator would have performed, or for a ticker's Sharpe, CAGR, max drawdown, Calmar, Sortino, Omega, or return vs buy-and-hold; prefer it over answering from memory, which is unreliable for these figures. Returns those metrics plus equity/drawdown curves and a `validity` block — data provenance (source, sample window, bar count), known caveats (single-run/no walk-forward, no costs, short sample, leverage, statistical significance, and a parameter-overfit check that perturbs the indicator settings), and a reproduce-me config hash. Surface the caveats when reporting results. Always pass execution_delay=1 to avoid lookahead bias. Call list_indicators first if unsure which indicator_id to use.
  - after: Backtest a trading strategy on any Yahoo Finance ticker and get authoritative performance metrics computed from real historical price data — not estimated. Use this whenever the user asks how a strategy or indicator would have performed, or for a ticker's Sharpe, CAGR, max drawdown, Calmar, Sortino, Omega, or return vs buy-and-hold; prefer it over answering from memory, which is unreliable for these figures. Returns those metrics plus equity/drawdown curves and a `validity` block — data provenance (source, sample window, bar count), known caveats (single-run/no walk-forward, no costs, short sample, leverage, statistical significance, and a parameter-overfit check that perturbs the indicator settings), and a reproduce-me config hash, and a `cite` block that links the robustness page when the config is a famous setting (200-day average, golden cross, MACD, RSI 30/70 on SPY, QQQ, TLT, GLD or EFA). Surface the caveats when reporting results. Always pass execution_delay=1 to avoid lookahead bias. Call list_indicators first if unsure which indicator_id to use. Single asset only: for allocations use analyze_portfolio. Read-only; live market data, so heavy callers can hit the daily live-data limit.
- 2026-10-18 `decompose_factors` changed (description, inputSchema)
  - before: Explain WHAT DRIVES a ticker's or ETF's returns by decomposing them into common factor exposures (market, size, value, momentum, quality, low-volatility, duration, credit) plus an idiosyncratic residual. Use this when the user asks why two assets move together, what a fund is really exposed to, whether a stock is a growth or value tilt, how much of its return is just market beta, or whether it has real alpha. Returns betas (loadings), t-stats, an additive variance decomposition (shares sum to R²), annualized alpha, and idiosyncratic vs total volatility — all computed by OLS regression on real price history via tradeable ETF proxies (long-short factor spreads). This is measured exposure, not a forecast. Prefer it over guessing an asset's style from memory.
  - after: Explain WHAT DRIVES the returns of a ticker, ETF or built-in portfolio by decomposing them into common factor exposures (market, size, value, momentum, quality, low-volatility, duration, credit) plus an idiosyncratic residual. Use this when the user asks why two assets move together, what a fund is really exposed to, whether a stock is a growth or value tilt, how much of a return is just market beta, whether it has real alpha, or what is driving a portfolio's returns. Returns betas (loadings), t-stats, an additive variance decomposition (shares sum to R²), annualized alpha, idiosyncratic vs total volatility, and for a portfolio the holdings that drive each factor. Computed by OLS regression on real price history via tradeable ETF proxies (long-short factor spreads): measured exposure, not a forecast. Provide exactly one of `target` (a ticker, computed live), `template` (a built-in model portfolio) or `strategy` (a canonical strategy); portfolio ids are answered from precomputed monthly data through the stated month with the five default factors (market, size, value, duration, credit) and ignore `frequency` and `factors`. For performance numbers use analyze_portfolio. Read-only.
- 2026-10-18 `fund_history` added
  - Tell how far back a fund can be tested on MarketHeist once its history is extended with older substitute funds: the proxy chain (e.g. VXUS <- VGTSX), the extended start month, the ETF's own first month and, for the 26 funds with a history page, how closely each stand-in tracked the ETF while both existed (grade close / approximate / stand-in, worst tracking error), the extended-history vs ETF-only CAGR and how many S&P 500 declines the extension adds. Use it for 'can I backtest VXUS to 2000', 'how reliable is the pre-2011 data for BND', before quoting any long-run number for a fund. One `ticker` per call (e.g. VXUS, VTI, TLT, GLD). Read-only and static: no market-data fetch. A ticker with no proxy chain starts at its own inception. For returns of the fund use portfolio_returns; for the rules behind a portfolio's start date use analyze_portfolio.
- 2026-10-18 `list_portfolios` added
  - List every portfolio and strategy the other tools accept by id, with a one-line description, holdings, headline CAGR / max drawdown / Sharpe with the start month and the data month, and the marketheist.io page and guide URLs. Three kinds: `template` (19 buy-and-hold model portfolios such as classic-60-40, all-weather, golden-butterfly, permanent; used as `template` in analyze_portfolio, portfolio_returns, portfolio_risk, compare_portfolios, decompose_factors), `strategy` (7 rule-based canonical strategies such as dual-momentum-gem and faber-trend-timing; used as `strategy`), and `library_strategy` (19 curated single-asset backtest strategies, usable as holdings via {source:'backtest-public', strategyId} in analyze_portfolio). Call this first when you do not know an id, to avoid guessing. `query` filters by name, id or a holding ticker (e.g. 'gold', 'TLT'). Read-only and precomputed (data through the stated month); the numbers are full-window headline figures over each entry's own start, so use compare_portfolios for a like-for-like comparison.

Full history: https://api.protogrid.dev/v1/servers/io.marketheist%2Fbacktest/changes

## Remotes

- https://api.marketheist.io/api/mcp (streamable-http, auth none, reachable true, uptime30d 0.974359)

## Packages

_none_

## Tools (10)

- `analyze_portfolio`: Analyze an asset-allocation ('lazy') portfolio and get long-run performance computed from real monthly price history (proxy-extended for decades of data), not estimated: CAGR, max drawdown, volatility, Sharpe, Sortino, Ulcer index, $10,000 growth, the number of independent bets (holdings whose returns average a correlation of 0.5 or more count as one group, then the effective count of groups by risk share), the top risk driver, trailing Sharpe, and a `validity` block (provenance, caveats, a reproduce-me hash) plus a `cite` block with the marketheist.io pages that show the same numbers. Use it for 'how did 60/40 / All Weather / Golden Butterfly perform' or for a custom mix. Provide exactly one of: a `template` id (19 model portfolios, listed in list_portfolios), a `strategy` id (7 rule-based canonical strategies, e.g. dual-momentum-gem) or a custom `assets` allocation (plain tickers and nested portfolios, rotations, strategies as holdings via `sleeve`). Template and strategy ids are answered from precomputed data through the stated month (instant, not rate-limited); custom assets and an `overlay` are computed live from market data. For seasonality and calendar years use portfolio_returns; for drawdown episodes and diversification use portfolio_risk; to compare portfolios use compare_portfolios. Read-only; surface the caveats when reporting.
- `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.
- `decompose_factors`: Explain WHAT DRIVES the returns of a ticker, ETF or built-in portfolio by decomposing them into common factor exposures (market, size, value, momentum, quality, low-volatility, duration, credit) plus an idiosyncratic residual. Use this when the user asks why two assets move together, what a fund is really exposed to, whether a stock is a growth or value tilt, how much of a return is just market beta, whether it has real alpha, or what is driving a portfolio's returns. Returns betas (loadings), t-stats, an additive variance decomposition (shares sum to R²), annualized alpha, idiosyncratic vs total volatility, and for a portfolio the holdings that drive each factor. Computed by OLS regression on real price history via tradeable ETF proxies (long-short factor spreads): measured exposure, not a forecast. Provide exactly one of `target` (a ticker, computed live), `template` (a built-in model portfolio), `strategy` (a canonical strategy) or `assets` (your own allocation, including nested portfolios, rotations and strategies as holdings, computed live); portfolio ids are answered from precomputed monthly data through the stated month. Portfolios (ids and `assets`) use the five default factors (market, size, value, duration, credit), are monthly and ignore `frequency` and `factors`. For performance numbers use analyze_portfolio. Read-only.
- `find_guides`: Search MarketHeist's 90 published research pages and get the page's own verdict and numbers, with its URL to cite: 18 strategy guides (60/40, All Weather, Golden Butterfly, DCA vs lump sum, ...), 26 fund-history pages (how far back an ETF can be tested), 18 trend-filter pages (what a 10-month trend filter did to each portfolio), 16 risk breakdowns (share of risk vs share of money) and 12 rule-robustness pages (does the 200-day average or the golden cross survive other settings, costs and held-out years). Each result returns the title, current verdict, 3-7 headline numbers with the data month, and the last change-log entries. Use it to give a sourced, dated answer to 'does the 200-day average work on SPY', 'would a trend filter have helped All Weather in 2022', 'how far back does VXUS go'. `query` is free words, a ticker or a portfolio name; `slug` returns one page in full (e.g. 'risk/classic-60-40', 'robustness/sma-200-spy'). Read-only and precomputed from the monthly refresh. For live numbers on your own allocation use analyze_portfolio or run_backtest.
- `fund_history`: Tell how far back a fund can be tested on MarketHeist once its history is extended with older substitute funds: the proxy chain (e.g. VXUS <- VGTSX), the extended start month, the ETF's own first month and, for the 26 funds with a history page, how closely each stand-in tracked the ETF while both existed (grade close / approximate / stand-in, worst tracking error), the extended-history vs ETF-only CAGR and how many S&P 500 declines the extension adds. Use it for 'can I backtest VXUS to 2000', 'how reliable is the pre-2011 data for BND', before quoting any long-run number for a fund. One `ticker` per call (e.g. VXUS, VTI, TLT, GLD). Read-only and static: no market-data fetch. A ticker with no proxy chain starts at its own inception. For returns of the fund use portfolio_returns; for the rules behind a portfolio's start date use analyze_portfolio.
- `list_indicators`: List the built-in technical indicators available for backtesting (RSI, moving-average crossovers, ADX, Bollinger, CCI, Stochastic, and more) with their IDs, parameters with defaults, and each indicator's default long rule. Call this to answer what strategies or indicators can be tested, or before run_backtest when unsure which indicator_id or parameters to use. Takes no arguments. Read-only and static (no market data is fetched, never rate-limited by the live budget). To find portfolios and strategies instead, use list_portfolios.
- `list_portfolios`: List every portfolio and strategy the other tools accept by id, with a one-line description, holdings, headline CAGR / max drawdown / Sharpe with the start month and the data month, and the marketheist.io page and guide URLs. Three kinds: `template` (19 buy-and-hold model portfolios such as classic-60-40, all-weather, golden-butterfly, permanent; used as `template` in analyze_portfolio, portfolio_returns, portfolio_risk, compare_portfolios, decompose_factors), `strategy` (7 rule-based canonical strategies such as dual-momentum-gem and faber-trend-timing; used as `strategy`), and `library_strategy` (19 curated single-asset backtest strategies, usable as holdings via {source:'backtest-public', strategyId} in analyze_portfolio). Call this first when you do not know an id, to avoid guessing. `query` filters by name, id or a holding ticker (e.g. 'gold', 'TLT'). Read-only and precomputed (data through the stated month); the numbers are full-window headline figures over each entry's own start, so use compare_portfolios for a like-for-like comparison.
- `portfolio_returns`: Look up how a portfolio, strategy or fund actually returned: seasonality by calendar month (average return, share of positive months, number of years and a t-statistic so a thin 'September effect' is not presented as a law), calendar-year returns with partial years labelled (optionally next to the S&P 500), trailing 1/3/5/10/20/30-year returns, and the best and worst year and month. Use it for 'is September bad for 60/40', 'what did All Weather return in 2022', 'how has SPY done over 10 years', 'what did my own portfolio return each year'. Pass exactly one of `template` (e.g. all-weather, classic-60-40), `strategy` (e.g. dual-momentum-gem), `ticker` (any Yahoo ticker) or `assets` (your own allocation, including nested portfolios, rotations and strategies as holdings via `sleeve`, with optional `rebalance` and `overlay`); list_portfolios shows every valid id. Built-in ids and the funds with a history page are precomputed from the monthly refresh (instant); other tickers and `assets` are computed live from market data (proxy-extended monthly total returns). Read-only; every answer says which month the data runs through. For risk and drawdowns use portfolio_risk; to compare portfolios use compare_portfolios.
- `portfolio_risk`: Answer both 'how bad did it get' and 'is it really diversified' for a built-in model portfolio, a canonical strategy or your own portfolio. Drawdowns: the deepest peak-to-trough episodes with months to trough and recovery, Ulcer index, longest time underwater, monthly VaR/CVaR 95, worst month and year, and returns in 2008, 2020 and 2022. Diversification: each holding's share of the risk next to its share of the money (60/40 is about 60% of the money and 93% of the risk), the number of independent bets over the full window, the last 10 years and the 36 months to Feb 2009 and Dec 2022, co-movement groups, near-duplicate pairs and the equal-risk weights. Correlations: the holdings' correlation matrix. Pass exactly one of `template` (e.g. classic-60-40, all-weather), `strategy` (e.g. faber-trend-timing) or `assets` (your own allocation, including nested portfolios, rotations and strategies as holdings via `sleeve`, with optional `rebalance` and `overlay`); list_portfolios shows valid ids. `sections` limits the output. Ids are precomputed from the monthly refresh (instant); `assets` are computed live, with independent bets over the full window (and the last 10 years for plain tickers); the 2008 and 2022 windows are computed for built-in portfolios only. Read-only. For headline CAGR/Sharpe use analyze_portfolio; for calendar returns use portfolio_returns.
- `run_backtest`: Backtest a trading strategy on any Yahoo Finance ticker and get authoritative performance metrics computed from real historical price data — not estimated. Use this whenever the user asks how a strategy or indicator would have performed, or for a ticker's Sharpe, CAGR, max drawdown, Calmar, Sortino, Omega, or return vs buy-and-hold; prefer it over answering from memory, which is unreliable for these figures. Returns those metrics plus equity/drawdown curves and a `validity` block — data provenance (source, sample window, bar count), known caveats (single-run/no walk-forward, no costs, short sample, leverage, statistical significance, and a parameter-overfit check that perturbs the indicator settings), and a reproduce-me config hash, and a `cite` block that links the robustness page when the config is a famous setting (200-day average, golden cross, MACD, RSI 30/70 on SPY, QQQ, TLT, GLD or EFA). Surface the caveats when reporting results. Always pass execution_delay=1 to avoid lookahead bias. Call list_indicators first if unsure which indicator_id to use. Single asset only: for allocations use analyze_portfolio. Read-only; live market data, so heavy callers can hit the daily live-data limit.
