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. اقرأ المزيد في شروط الاستخدام.