OPEN-SOURCE SCRIPT
P/E Based Earnings Signals

P/E Based Earnings Signals
This script is an event-driven indicator that evaluates earnings releases through a valuation and share-structure lens. Instead of focusing only on price action, it uses reported earnings data, estimated earnings data, and shares outstanding to identify conditions that may be relevant after an earnings update.
The main idea is to filter earnings events using simple but specific fundamental rules, then display signals only when those conditions are met.
Concept:
Many earnings-based tools focus only on whether a company beat or missed expectations. This script takes a more structured approach by combining:
• Actual earnings-based P/E
• Estimated earnings-based P/E
• Share structure stability over time
The goal is to identify earnings events where valuation conditions and dilution stability align with the signal logic.
How It Works
The script requests:
• Actual EPS from earnings data
• Estimated EPS from earnings data
• Total shares outstanding from financial data
It then calculates:
• Actual P/E = Price / Actual EPS
• Estimated P/E = Price / Estimated EPS
Signals are only evaluated on bars where a new earnings value is detected.
Buy Signal Logic
A buy signal requires all of the following:
• A new earnings event is detected
• Actual P/E is above the selected buy threshold
• Actual P/E is greater than estimated P/E
• Shares outstanding have remained relatively stable over the selected lookback period
This is intended to isolate higher-P/E earnings events while excluding names with major recent changes in share structure.
Sell Signal Logic
A sell signal requires all of the following:
• A new earnings event is detected
• Actual P/E is below the selected sell threshold
• Estimated P/E is at or above the selected expected threshold
• Shares outstanding have remained relatively stable over the selected lookback period
This is intended to flag lower-P/E earnings conditions under a separate valuation filter.
Share Structure Filter
One part of the script is dedicated to filtering out companies with large recent changes in shares outstanding.
It compares current shares outstanding to a historical reference point over a configurable number of days and calculates the percentage change.
If the change exceeds the selected threshold, signals are blocked.
This helps reduce noise from companies with unstable share structures or significant dilution.
Visual Features
• Buy labels below price when buy conditions are met
• Sell labels above price when sell conditions are met
• Earnings bars highlighted in the background
• Summary table showing current P/E values, share change, and signal status
Dashboard Metrics
The built-in table displays:
• Reported P/E
• Estimated P/E
• 1-year share change percentage
• Current buy status
• Current sell status
This makes it easier to understand why a signal did or did not trigger.
Use Cases
This tool may be useful for:
• Earnings-focused traders
• Fundamental event screening
• Combining valuation filters with chart review
• Monitoring companies with more stable share structures
Notes
This script is a rules-based earnings filter, not a complete investment model.
It is best used alongside:
• Fundamental research
• Price action review
• Broader context around the earnings report
• Risk management
Because financial data can vary by symbol and reporting availability, users should verify that the required data fields are supported for the instrument being analyzed.
This script is an event-driven indicator that evaluates earnings releases through a valuation and share-structure lens. Instead of focusing only on price action, it uses reported earnings data, estimated earnings data, and shares outstanding to identify conditions that may be relevant after an earnings update.
The main idea is to filter earnings events using simple but specific fundamental rules, then display signals only when those conditions are met.
Concept:
Many earnings-based tools focus only on whether a company beat or missed expectations. This script takes a more structured approach by combining:
• Actual earnings-based P/E
• Estimated earnings-based P/E
• Share structure stability over time
The goal is to identify earnings events where valuation conditions and dilution stability align with the signal logic.
How It Works
The script requests:
• Actual EPS from earnings data
• Estimated EPS from earnings data
• Total shares outstanding from financial data
It then calculates:
• Actual P/E = Price / Actual EPS
• Estimated P/E = Price / Estimated EPS
Signals are only evaluated on bars where a new earnings value is detected.
Buy Signal Logic
A buy signal requires all of the following:
• A new earnings event is detected
• Actual P/E is above the selected buy threshold
• Actual P/E is greater than estimated P/E
• Shares outstanding have remained relatively stable over the selected lookback period
This is intended to isolate higher-P/E earnings events while excluding names with major recent changes in share structure.
Sell Signal Logic
A sell signal requires all of the following:
• A new earnings event is detected
• Actual P/E is below the selected sell threshold
• Estimated P/E is at or above the selected expected threshold
• Shares outstanding have remained relatively stable over the selected lookback period
This is intended to flag lower-P/E earnings conditions under a separate valuation filter.
Share Structure Filter
One part of the script is dedicated to filtering out companies with large recent changes in shares outstanding.
It compares current shares outstanding to a historical reference point over a configurable number of days and calculates the percentage change.
If the change exceeds the selected threshold, signals are blocked.
This helps reduce noise from companies with unstable share structures or significant dilution.
Visual Features
• Buy labels below price when buy conditions are met
• Sell labels above price when sell conditions are met
• Earnings bars highlighted in the background
• Summary table showing current P/E values, share change, and signal status
Dashboard Metrics
The built-in table displays:
• Reported P/E
• Estimated P/E
• 1-year share change percentage
• Current buy status
• Current sell status
This makes it easier to understand why a signal did or did not trigger.
Use Cases
This tool may be useful for:
• Earnings-focused traders
• Fundamental event screening
• Combining valuation filters with chart review
• Monitoring companies with more stable share structures
Notes
This script is a rules-based earnings filter, not a complete investment model.
It is best used alongside:
• Fundamental research
• Price action review
• Broader context around the earnings report
• Risk management
Because financial data can vary by symbol and reporting availability, users should verify that the required data fields are supported for the instrument being analyzed.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.