Best Buffett Ratio w/ Std-Dev Offset + Conditional PlotSummary:
This script provides a visually clear way to track the so-called “Buffett Ratio,”
a popular market valuation gauge which compares the total US stock market cap
to the country’s GDP. In addition, it plots a “hardcoded” long-term trend line,
along with fixed standard-deviation bands (in log space), and uses background colors
to signal potentially overvalued or undervalued zones.
What Is the Buffett Ratio?
Often credited to Warren Buffett, the Buffett Ratio (or Buffett Indicator) measures:
(Total US Stock Market Capitalization) / (US GDP)
• A higher ratio typically means equities are more expensive relative to the size of the economy.
• A lower ratio suggests equities may be more attractively valued compared to GDP.
Historically, the ratio has tended to drift upward over many decades,
as the US economy and stock markets grow, but it still oscillates around some trend over time.
How to Use
1) Add to Chart:
- In TradingView, simply apply the indicator (it internally fetches CRSPTM1 & GDP data).
2) Tweak Inputs:
- Log Offset for 1σ: Adjust how wide the ±1σ/±2σ bands appear around the trend.
- Anchor Points: Edit startYear , endYear , startRatio , endRatio
if you want a different slope or different “fair value” anchors.
3) Interpretation:
- If the indicator is above +2σ (red line) , it’s historically “very expensive,”
often leading to lower future returns over the long term.
- If it’s below –2σ (green line) , it’s historically “deep undervaluation,”
often pointing to better future returns over time.
- The intermediate zones show degrees of mild over- or undervaluation.
How This Script Works
1) Buffett Ratio Calculation:
- The script requests data from TradingView’s built-in CRSPTM1 index (total US market cap).
- It also requests US GDP data via request.economic("US", "GDP") .
- If GDP data is missing, the ratio becomes na on that bar.
2) Hardcoded Trend Line:
- Rather than a rolling average, the script uses two “anchors” (e.g. 1950 → 0.30 ratio, 2024 → 1.25 ratio)
and solves for a single log-growth rate to produce a steady upward slope.
3) Fixed Standard Deviations in Log Space:
- The script takes the log of the trend line, then applies a fixed offset for ±1σ and ±2σ,
creating proportional bands that do not “expand/contract” from a rolling window.
4) Conditional Plotting:
- The script only begins plotting once the Buffett Ratio actually has data (around 2011).
5) Color-Coded Zones:
- Above +2σ: red background (historically very expensive)
- Between +1σ and +2σ: yellow background (moderately expensive)
- Between –1σ and +1σ: no background color (around normal)
- Between –2σ and –1σ: aqua background (moderately undervalued)
- Below –2σ: green background (historically deep undervaluation)
Final Notes
• Data Limitations: US GDP data and CRSPTM1 only go back so far, so this starts around 2011.
• Long-Term vs. Short-Term: Best viewed on monthly/quarterly charts and interpreted over years.
• Tuning: If you believe structural changes have shifted the ratio’s fair slope,
adjust the code’s anchors or log offsets.
Enjoy, and use responsibly!
Buffettindicator
Buffett Valuation Indicator [TradeDots]The Buffett Valuation Indicator (also known as the Buffett Index or Buffett Ratio) measures the ratio of the total United States stock market to GDP.
This indicator helps determine whether the valuation changes in US stocks are justified by the GDP level.
For example, the ratio is calculated based on the standard deviations from the historical trend line. If the value exceeds +2 standard deviations, it suggests that the stock market is overvalued relative to GDP, and vice versa.
This "Buffett Valuation Indicator" is an enhanced version of the original indicator. It applies a Bollinger Band over the Valuation/GDP ratio to identify overvaluation and undervaluation across different timeframes, making it efficient for use in smaller timeframes, e.g. daily or even hourly intervals.
HOW DOES IT WORK
The Buffett Valuation Indicator measures the ratio between US stock valuation and US GDP, evaluating whether stock valuations are overvalued or undervalued in GDP terms.
In this version, the total valuation of the US stock market is represented by considering the top 10 market capitalization stocks.
Users can customize this list to include other stocks for a more balanced valuation ratio. Alternatively, users may use S&P 500 ETFs, such as SPY or VOO, as inputs.
The ratio is plotted as a line chart in a separate panel below the main chart. A Bollinger Band with a default 100-period and multiples of 1 and 2 is used to identify overvaluation and undervaluation.
For instance, if the ratio line moves above the +2 standard deviation line, it indicates that stocks are overvalued, signaling a potential selling opportunity.
APPLICATION
When the indicator is applied to a chart, we observe the ratio line's movements relative to the standard deviation lines. The further the line deviates from the standard deviation lines, the more extreme the overvaluation or undervaluation.
We look for buying opportunities when the Buffett Index moves below the first and second standard deviation lines and sell opportunities when it moves above these lines. This indicator is used as a microeconomic confirmation tool, in combination with other indicators, to achieve higher win-rate setups.
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.