haribotagada

Historical PE ratio vs median

The Trailing Twelve-Month Price-to-Earnings (TTM P/E) Ratio vs. Median Value Indicator is a financial analytical tool designed to assess the current valuation of a stock or index in comparison to its historical norm. This is achieved by calculating the P/E ratio using the sum of the entity's earnings per share (EPS) over the past twelve months and dividing it by its current share price. The resulting TTM P/E ratio is then compared against the median P/E ratio calculated over a specified historical period.

The median P/E ratio serves as a benchmark, representing the midpoint of the entity's valuation over the selected timeframe, thus smoothing out short-term volatility and anomalies. By comparing the current TTM P/E ratio to this median, the indicator provides a relative measure of whether the stock or index is currently overvalued, undervalued, or trading at its historical valuation norms.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?