OPEN-SOURCE SCRIPT
Cập nhật PE Rating by The Noiseless Trader

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
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.
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
- 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.
- We do not short the stock at High PE infact be cautious with long trades.
- Helps identify whether current price action is happening near overvalued or undervalued zones.
- 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.
- 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 UpdateThis 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:
- Green: Revenue rising, Net Income rising (strong)
- Orange: Revenue rising, Net Income falling (mixed)
- Blue: Revenue falling, Net Income rising (mixed)
- Red: Revenue falling, Net Income falling (weak)
- 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
- New 3-year PE High
- New 3-year PE Low
- New 1-year Intermediate PE Low
- Financial Health Status Changed (with specific alerts for each of the four states)
How to Use
- Add the indicator to a daily chart of any stock with available EPS data.
- 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.
- Check the dashboard on the price chart for a quick summary of PE positioning, fundamental health, and valuation zone.
- Use the background color as a visual guide to fundamental momentum — green periods suggest improving business performance.
- Monitor the support/resistance lines on the price chart for potential price levels tied to PE extremes.
- 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
- Requires stocks with Diluted EPS (TTM) data available on TradingView. An orange warning appears if data is missing.
- Fundamental health comparison uses a ~63 trading day lag; actual earnings dates may vary.
- PE-based analysis has inherent limitations for loss-making companies where EPS is negative or zero.
- Support/resistance lines are based on historical PE extremes and do not guarantee future price behavior.
- This tool is for educational and informational purposes only and is not financial advice.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
The Noiseless Trader — Structure first. Then price. Then confirmation. | Explore more with TNT One thenoiselesstrader.com/s/pages/tntone | An extensive library of 200+ hours of actionable financial market knowledge
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
The Noiseless Trader — Structure first. Then price. Then confirmation. | Explore more with TNT One thenoiselesstrader.com/s/pages/tntone | An extensive library of 200+ hours of actionable financial market knowledge
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.