OPEN-SOURCE SCRIPT

Forward P/E

מעודכן
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.
הערות שחרור
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

סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?

כתב ויתור