OPEN-SOURCE SCRIPT
Cập nhật

PE Rating by The Noiseless Trader

3 070
PE Rating by The Noiseless Trader
This script analyzes a symbol’s Price-to-Earnings (P/E) ratio, using Diluted EPS (TTM) fundamentals directly from TradingView.

The script calculates the Price-to-Earnings ratio (P/E) using Diluted EPS (TTM) fundamentals. It then identifies:
PE High → the highest valuation point over a 3-year historical range.
PE Low → the lowest valuation point over a 3-year historical range.
PE Median → the midpoint between the two extremes, offering a fair-value benchmark.
PE (Int) → an additional intermediate low to track more recent undervaluation points. This is calculated based on lowest valuation point over a 1-year historical range

These levels are plotted directly on the chart as horizontal references, with markers showing the exact bars/dates when the extremes occurred. Candles corresponding to those days are also highlighted for context.

Bars corresponding to these extremes are highlighted (red = PE High, green = PE Low).

How it helps
  1. Provides a historical valuation framework that complements technical analysis. We look for long opportunity or base formation near the PE Low and be cautious when stocks tends to trade near High PE.
  2. We do not short the stock at High PE infact be cautious with long trades.
  3. Helps identify whether current price action is happening near overvalued or undervalued zones.
  4. Adds a long-term perspective to support swing trading and investing decisions. If a stock is coming from Low PE to Median PE and along with that if we get entry based on Classical strategies like Darvas Box, or HH-HL based on Dow Theory.
  5. Offers a simple visual map of how far the market has moved from “cheap” to “expensive.”


This tool is best suited for long-term investors and swing traders who want to merge fundamentals with technical setups.

This indicator is designed as an educational tool to illustrate how valuation metrics (like earnings multiples) can be viewed alongside price action, helping traders connect fundamental context with technical execution in real market conditions.
Phát hành các Ghi chú
What's New in This Update

This is a significant upgrade to the PE Rating indicator. Here is what has changed:

Multi-Timeframe Consistency
The indicator now fetches all PE data from the daily timeframe using request.security, regardless of which chart timeframe you are viewing. Whether you are on a daily, weekly, or monthly chart, the PE values, 3-year high/low, and 1-year intermediate low are always computed using daily bars. This eliminates the earlier issue where switching timeframes produced inconsistent or incorrect PE readings.

PE Score
A new percentile-based PE Score has been added. It measures how much room the current PE has to move toward its 3-year high. A score of 95% means the PE is near its 3-year low with significant room to expand. A score of 5% means the PE is near its 3-year peak with little room left. The score is displayed in the dashboard and is color-coded green (attractive), yellow (neutral), or red (expensive).

PE Zone Classification
The PE Score is mapped to five zones: Very Low PE, Low PE, Medium PE, High PE, and Very High PE. This gives you a quick text-based read of where the stock sits within its own 3-year PE range.

Fundamental Health Tracking
The indicator now tracks Trailing Twelve Months (TTM) Revenue and TTM Net Income. It compares current values with the previous quarter to determine whether fundamentals are improving or deteriorating. The indicator background color reflects this:
  1. Green: Revenue rising, Net Income rising (strong)
  2. Orange: Revenue rising, Net Income falling (mixed)
  3. Blue: Revenue falling, Net Income rising (mixed)
  4. Red: Revenue falling, Net Income falling (weak)
  5. Gray: Data not available


When financial data is not yet published for a company, the background shows gray instead of incorrectly signaling a decline.

Dashboard on Price Chart
A redesigned dashboard table is displayed on the price chart (bottom-right corner) showing: Current PE, 3Y High, 3Y Low, Median, 1Y Intermediate Low, PE Score, PE Zone, TTM Revenue, TTM Net Income, and overall Health Status — all in one compact view.

Support and Resistance Lines
The indicator draws horizontal lines on the price chart at the price levels where PE extremes occurred. A red line marks the price at the 3-year PE high (resistance), green solid lines mark the 3-year PE low (support), and green dotted lines mark the 1-year intermediate low. Lines extend forward until price closes beyond them (breach), then stop — remaining visible for historical reference. New lines are drawn when fresh PE extremes form.

Quarter Markers
Subtle vertical dotted lines mark the start of each calendar quarter (January, April, July, October) in the PE pane, helping you see when financial data likely updated.

Median Cross Alert with Health Filter
A new alert triggers when PE crosses above its median from below while fundamentals are in Strong (green) territory. This combination may indicate an attractive valuation setup.

Additional Alerts
  1. New 3-year PE High
  2. New 3-year PE Low
  3. New 1-year Intermediate PE Low
  4. Financial Health Status Changed (with specific alerts for each of the four states)


How to Use
  1. Add the indicator to a daily chart of any stock with available EPS data.
  2. The PE line (teal) shows the current Price-to-Earnings ratio. The red line is the 3-year high, the green line is the 3-year low, and the blue circles represent the median.
  3. Check the dashboard on the price chart for a quick summary of PE positioning, fundamental health, and valuation zone.
  4. Use the background color as a visual guide to fundamental momentum — green periods suggest improving business performance.
  5. Monitor the support/resistance lines on the price chart for potential price levels tied to PE extremes.
  6. Set up alerts for PE extreme events or fundamental health transitions.


The indicator is optimized for the daily timeframe. On weekly or monthly charts, a warning label appears, but the data remains consistent as it always uses daily values.

Companion Screener
Use "PE Rating by The Noiseless Trader (PINE Screener)" in Pine Screener to scan and filter stocks based on PE Score, 3Y High/Low, and Above Median status across your entire watchlist.

Limitations
  1. Requires stocks with Diluted EPS (TTM) data available on TradingView. An orange warning appears if data is missing.
  2. Fundamental health comparison uses a ~63 trading day lag; actual earnings dates may vary.
  3. PE-based analysis has inherent limitations for loss-making companies where EPS is negative or zero.
  4. Support/resistance lines are based on historical PE extremes and do not guarantee future price behavior.
  5. This tool is for educational and informational purposes only and is not financial advice.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.