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.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.