OPEN-SOURCE SCRIPT

Stock Fundamental Overlay [DarwinDarma]

457
Stock Fundamental Overlay [DarwinDarma]

Stock Fundamental Overlay is a comprehensive valuation indicator that displays multiple fundamental analysis metrics directly on your price chart.

Key Features:
• Graham Number - Benjamin Graham's intrinsic value formula
• Book Value Per Share (BVPS) - Net asset value baseline
• DCF Valuation - Discounted Cash Flow analysis (non-financial stocks)
• DDM Valuation - Dividend Discount Model (dividend-paying stocks)
• Visual Value Zones - Color-coded undervalued/overvalued regions
• Real-time Fundamental Table - Live metrics and valuations
• Price vs Graham Comparison - Quick valuation assessment
• Built-in Alerts - Notification when price crosses key levels

Valuation Models:
• Graham Number: √(22.5 × EPS × BVPS)
• DCF: Customizable discount rate, growth rate, and forecast period
• DDM: Gordon Growth Model for dividend analysis

Visual Elements:
• Plot lines for BVPS, Graham Number, and DCF values
• Shaded value zone between BVPS and Graham Number
• Background coloring: Deep value (below BVPS), Undervalued (below Graham), Overvalued (>1.5x Graham)
• Dynamic table showing all metrics with theme-aware text colors

Special Handling:
• Financial sector detection - DCF disabled for banks/financials where FCF metrics are distorted
• Automatic light/dark theme adaptation
• TTM (Trailing Twelve Months) data for current metrics

How to Use - Value Investing Approach:

1. Identifying Undervalued Stocks:
• Look for price trading BELOW the Graham Number (green zone) - potential value opportunity
• Deep value: Price below BVPS indicates trading below net asset value
• Check "Price vs Graham" % in table - negative values suggest undervaluation
• Compare multiple models: When price is below Graham, DCF, and BVPS simultaneously, stronger buy signal

2. Margin of Safety:
• Benjamin Graham recommended buying at 2/3 of intrinsic value (33% margin of safety)
• Monitor the gap between current price and valuation lines
• Larger gaps = greater margin of safety = lower downside risk
• Use the shaded "Value Zone" as your target buying range

3. Setting Alerts:
• "Price Below Graham Number" - Notifies when stock enters value territory
• "Price Below Book Value" - Extreme value alert for deep value hunters
• "Price Below DCF Value" - Cash flow-based value signal
• Set alerts on watchlist stocks to catch value opportunities

4. Customizing for Your Strategy:
• Conservative investors: Use lower growth rates (3-4%) and higher discount rates (12-15%)
• Growth-value investors: Adjust growth rate (6-8%) for quality compounders
• Dividend investors: Focus on DDM value and Div/Share metrics
• Adjust forecast years based on business predictability (stable = 10 years, cyclical = 5 years)

5. Red Flags to Avoid:
• Negative EPS or FCF (red values in table) - proceed with caution
• Financial sector stocks - Use DDM and Graham, ignore DCF
• Price far above Graham (>1.5x) with red background = overvalued territory
• No fundamental data = "N/A" in table - stock may lack reporting or be too small
• Stock persistently below BVPS for extended periods - potential value trap or business in distress
• Price significantly above ALL models (BVPS, Graham, DCF) - sentiment-driven, lacks intrinsic value foundation (fragile)

⚠️ Important Value Investing Warnings:
Value Trap Alert: A stock staying below BVPS for months/years may signal fundamental deterioration, asset impairments, or dying industry - not just "cheap." Investigate WHY it's cheap before buying
Sentiment Bubble Risk: When price trades far above BVPS, Graham Number, AND DCF simultaneously, the stock has no intrinsic value basis. Examples: commodity stocks during boom cycles (gold miners in gold rallies), meme stocks, hype-driven sectors. These are highly fragile and vulnerable to mean reversion
Cyclical Trap: Commodity/cyclical stocks can appear "cheap" at peak earnings (low P/E, high FCF) but are actually expensive. Normalize earnings across the cycle before valuing
Quality Matters: Some excellent businesses (asset-light, high ROIC) naturally trade above book value. Don't avoid quality - adjust expectations for business model

6. Monitoring Positions:
• Watch for price approaching or exceeding Graham Number - consider taking profits
• Track EPS and FCF trends quarter-to-quarter in the table
• If fundamentals deteriorate (falling BVPS, negative FCF), reassess thesis
• Use background colors for quick visual check: green = hold/buy, red = overvalued

Perfect for:
Value investors seeking multi-model fundamental analysis, long-term investors comparing intrinsic value to market price, dividend investors evaluating yield stocks, and fundamental traders looking for entry/exit signals.

Note: Only works with stocks that have financial data available. Not applicable to crypto, forex, or futures. This indicator provides analysis tools; always conduct thorough research and due diligence before investing.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.