OPEN-SOURCE SCRIPT

Forward P/E

Actualizado
The Forward P/E indicator calculates and visualizes the forward price-to-earnings (P/E) ratio of a stock based on its most recent quarterly earnings per share (EPS) and the current market price.

Key Features:
  • Quarterly EPS Data: The script retrieves the diluted EPS for the most recent fiscal quarter (FQ) of the selected stock using financial data.
  • Annualized EPS: The quarterly EPS is multiplied by four to estimate the annualized EPS, assuming consistent earnings throughout the year.
  • Forward P/E Calculation: The forward P/E is derived by dividing the stock's current closing price by its annualized EPS.
  • Visualization: The calculated forward P/E ratio is plotted for easy interpretation.
  • Reference Line: An optional horizontal reference line at 0 helps quickly identify when the P/E ratio becomes invalid or potentially negative due to anomalies in EPS data.


This tool is useful for investors and traders seeking to evaluate a stock's valuation relative to its projected earnings, helping identify potentially overvalued or undervalued opportunities.
Notas de prensa
The Forward P/E with Median indicator calculates and visualizes the forward price-to-earnings (P/E) ratio of a stock and includes a rolling median to help identify trends or central tendencies in valuation over time.

Key Features:
  • Quarterly EPS Data: Retrieves the diluted EPS for the most recent fiscal quarter (FQ) of the selected stock using financial data.
  • Annualized EPS: Quarterly EPS is multiplied by four to estimate annualized EPS, assuming consistent earnings throughout the year.
  • Forward P/E Calculation: The forward P/E is derived by dividing the stock's current closing price by its annualized EPS.
  • Median Forward P/E: A rolling median of the forward P/E ratio is calculated over a user-defined window (default: 14 periods) and plotted for trend analysis.
  • Visualization:
  • The Forward P/E ratio is plotted in blue.
  • The Median Forward P/E is plotted in orange for comparison and trend analysis.


Reference Line: An optional horizontal line at 0 helps identify anomalies, such as negative or invalid P/E values.

This enhanced tool is useful for investors and traders aiming to assess a stock's valuation trends and stability relative to its projected earnings, helping identify consistent overvaluation or undervaluation opportunities.
forecastingstatisticsValue

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad