portfolio_beta
Calculate your portfolio's beta against a benchmark using daily returns. Get holding-level betas and data coverage to gauge market sensitivity.
Instructions
Compute the beta of a portfolio you supply against a benchmark.
Use this to answer how sensitive a set of holdings is to a market index — "what is my portfolio's beta to the S&P", "is this book more or less volatile than the market". Beta is estimated from daily returns over the lookback window.
You must pass the holdings in; this tool has no access to any brokerage account and
cannot look up what someone owns. Weights need not sum to 1. Non-US listings need
an exchange code to resolve the right venue.
Returns the portfolio beta, each holding's individual beta, and — importantly — the
number of overlapping observations and the date range actually used, which is
usually shorter than the range requested because of holidays and listing dates. A
beta computed on very few observations comes back with a note saying so, and
comes back as null rather than a misleading number when there are too few to
estimate at all.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| holdings | Yes | ||
| benchmark | No | SPY | |
| lookback_days | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | Last date in the window used. | |
| beta | Yes | Portfolio beta, or null when too few overlapping observations exist. | |
| note | No | Set when the result needs a caveat, e.g. a short window. | |
| start | Yes | First date in the window used (not requested). | |
| benchmark | Yes | ||
| per_holding | No | Beta of each holding against the benchmark. | |
| observations | Yes | Overlapping daily observations actually used. |