OPEN-SOURCE SCRIPT

Household Equity Allocation -- Positioning Gauge

302
█ OVERVIEW

This indicator plots, in its own pane, the percentage of United States household financial assets held in corporate equities, requested live from the Federal Reserve Z.1 financial accounts. It ranks the current reading against an embedded multi-decade history, classifies it into posture zones, and reports an indicative long-horizon estimate, presenting household equity positioning as a slow, low-frequency context gauge rather than a price-derived trading signal.


█ HISTORY / BACKGROUND

The series shown is published by the Federal Reserve Board in the Z.1 Financial Accounts of the United States, formerly the Flow of Funds, available quarterly since 1945. It measures households' directly and indirectly held corporate equities as a share of their financial assets. Its use as a forward-looking context measure was popularized by the analyst writing as Philosophical Economics in 2013, who examined its historical relationship with subsequent long-horizon equity returns and contrasted it with Robert Shiller's cyclically adjusted price-to-earnings ratio.

The conceptual basis is an accounting identity rather than a behavioral model: investors in aggregate must hold the entire outstanding supply of equities, so the equity share of household assets can rise only when equity prices rise relative to the supply of other assets. The measure is therefore a positioning and relative-valuation reading expressed in committed dollars, not a sentiment survey. The script applies no proprietary transformation to the series; it requests the published values and contextualizes them.


█ HOW IT WORKS

- The script requests the series named by the FRED series input (default FRED:BOGZ1FL153064486Q) with request.security at a quarterly (3M) resolution, lookahead disabled and gaps off, taking the published close as the current allocation reading.
- A fixed baseline of annual year-end values from 1945 through 2025 is loaded once into an array on the first bar. After a hardcoded cutoff (Q4 2025) the script appends each new distinct live reading to that array, so the baseline extends automatically as new quarters are published.
- A percentile routine counts the baseline entries less than or equal to the current reading and returns that count as a percentage of the array size, giving the reading's full-history percentile.
- The reading is classified into one of four zones by comparison against the three threshold inputs: below Bottom-quintile, below Top-quintile, below Above historical range, or at or above it. Each zone maps to a color and a posture label.
- An indicative estimate is computed as a fixed linear function of the reading, with intercept 12.338 and slope -0.3978, using constants hardcoded in the script. When the reading exceeds the in-sample maximum of 38.7, the estimate is marked as an extrapolation.
- The allocation is drawn as a line colored by the active zone. Three dashed horizontal lines mark the thresholds, and an optional background tint shades the pane by zone. An optional table in the top right reports the current value, its full-history percentile, the posture, the indicative estimate (flagged when extrapolated), the in-sample maximum, and the data source. The table is built only on the last bar.


█ HOW TO USE

The output is read from the pane and the table.

- The line and its color show where positioning currently sits: green for the lowest band, gold for a neutral band, amber for an elevated band, and red for a reading above the historical range. The posture label in the table names the same state.
- The dashed lines are the zone thresholds, and the optional background tint repeats the active zone for quick reading.
- The table states the current value, its percentile against the full history, the posture, and the indicative long-horizon estimate, with a flag when that estimate is extrapolated beyond the historical range.

Recommended timeframe: the underlying data is quarterly and the script requests it at a quarterly resolution regardless of the chart's timeframe, so the displayed value is identical on every chart timeframe. A monthly or weekly chart on a long-history instrument is suggested only so the plotted line spans a useful visual range; the value and table do not depend on the chart timeframe or the chart symbol. Because the series is slow and lagged, it is intended for strategic, low-frequency context, not intraday or short-term use.


█ SETTINGS

- FRED series (symbol, default FRED:BOGZ1FL153064486Q): the economic series the script requests and contextualizes.
- Shade posture zones (on or off, default on): toggles the background tint that colors the pane by the active zone.
- Show info table (on or off, default on): toggles the top-right summary table.
- Bottom-quintile (cheap) below (number, default 14.0): the upper bound of the lowest zone, in percent.
- Top-quintile (underweight) above (number, default 28.0): the level above which the reading is treated as elevated.
- Above historical range above (number, default 39.0): the level above which the reading is treated as beyond the historical range.


█ WHAT MAKES IT ORIGINAL

The script does not compute a price-based study. It is a self-contained method for contextualizing a single external economic series on a chart. Its construction is specific: it pulls the series live through request.security; it ranks the current reading against a historical distribution embedded directly in the script and extended automatically after a cutoff date, so the percentile is point-in-time and does not depend on how much chart history is loaded; it maps the reading to posture zones by user thresholds; and it computes an indicative estimate from a fixed linear fit while explicitly flagging when the current reading lies beyond the data range that produced the fit. The combination of an embedded, self-extending baseline for percentile ranking, the posture zoning, and the extrapolation flag, presented together for this macro series in one pane and table, is what distinguishes it. It applies no proprietary formula on price; the contribution is the contextualization method.


█ NOTES / LIMITATIONS

- Data dependence: the script plots an external economic series, not chart price, and requires access to the configured economic symbol through your data subscription. If the symbol cannot be resolved the request returns na, the line does not plot, and the table shows n/a.
- Chart history and rendering: the percentile baseline and the table are independent of chart history because the baseline is embedded in the script, but the plotted line spans only the bars loaded on the chart, so on a short chart the visible line is short. The table is built only on the last bar.
- Frequency and revision: the source is quarterly and reported with a lag, so the value changes only when a new quarter is published, and the most recent value can be revised by the source.
- Request behavior: the series is requested with lookahead disabled, so no future data is placed on historical bars, and values are carried forward between releases. Historical readings do not repaint; only the most recent reading can change as the source releases or revises a quarter.
- Baseline granularity and cutoff: the embedded baseline holds one value per year (annual year-end) from 1945 through 2025, and live values are appended only after the hardcoded Q4 2025 cutoff, so the percentile reference is annual before that date and extends quarterly thereafter.
- Extrapolation: the indicative estimate is fit over readings up to 38.7, and current readings exceed that, so the estimate lies outside the fitted range and is flagged as such.
- Symbol scope: the script is independent of the chart symbol and can be applied to any chart, since it does not read the chart's price.


This script displays historical economic data and a derived estimate for research and educational purposes. It is not investment advice.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.