OPEN-SOURCE SCRIPT

CAPE / Shiller PE Ratio - cristianhkr

111
The Cyclically Adjusted Price-to-Earnings Ratio (CAPE Ratio), also known as the Shiller P/E Ratio, is a long-term valuation measure for stocks. It was developed by Robert Shiller and smooths out earnings fluctuations by using an inflation-adjusted average of the last 10 years of earnings.

This TradingView Pine Script indicator calculates the CAPE Ratio for a specific stock by:

Fetching historical Earnings Per Share (EPS) data using request.earnings().
Adjusting the EPS for inflation by dividing it by the Consumer Price Index (CPI).
Computing the 10-year (40-quarter) moving average of the inflation-adjusted EPS.
Calculating the CAPE Ratio as (Stock Price) / (10-year Average EPS adjusted for inflation).
Plotting the CAPE Ratio on the chart with a reference line at CAPE = 20, a historically significant threshold.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.