OPEN-SOURCE SCRIPT
Stock Fundamental Overlay [DarwinDarma]

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.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.