PROTECTED SOURCE SCRIPT

Ultimate Fundamental Fortress

45
Script Overview
This script provides a comprehensive Fundamental Health Scorecard for stocks, calculating a normalized score out of 100 based on key financial metrics fetched from TradingView's fundamental data. It displays the results in an elegant table with customizable colors, a dynamic plot for visualization, and a scorecard label for quick insights. The scorecard helps users assess a stock's value, profitability, and financial strength at a glance.

Purpose
The primary goal is to simplify fundamental analysis by aggregating essential ratios into a single, easy-to-interpret score. Inspired by value investing principles (e.g., low P/E and P/B for undervalued stocks, high ROE for efficiency), it empowers traders and investors to identify strong fundamentals quickly. It's especially useful for screening undervalued opportunities or comparing stocks within sectors.

Principles
Metrics Selection: Focuses on core fundamentals: Price-to-Book (P/B), Price-to-Earnings (P/E), Return on Equity (ROE), Debt-to-Equity (D/E), Free Cash Flow (FCF normalized by market cap), EBITDA (normalized by market cap), and Net Profit Margin. These are chosen for their balance of valuation, profitability, and risk assessment.

Scoring Philosophy: Each metric is scored based on thresholds (e.g., low ratios for valuation metrics indicate better value). If manual sector averages are provided, scoring becomes relative (e.g., stock P/B below sector average gets higher points), reducing subjectivity and adapting to industry norms. Without averages, absolute thresholds apply.

Normalization: Scores are summed and scaled to 100, ignoring missing data to ensure robustness. This allows fair comparison across stocks with varying data availability.

Customization: Users can adjust thresholds, colors, and sector averages for personalized analysis, making it flexible for different markets or strategies.

Calculation Methodology

Data Fetching: Uses request.financial() to pull quarterly (FQ) or trailing twelve months (TTM) data for metrics like BVPS, EPS, ROE, etc.

Ratio Computations:
P/B = Close Price / BVPS
P/E = Close Price / EPS
ROE = Directly fetched
D/E = Total Liabilities / Equity
Net Margin = Net Income / Revenue
Normalized FCF = FCF / Market Cap (as percentage)
Normalized EBITDA = EBITDA / Market Cap (as percentage)

Scoring:
For each metric, compare to thresholds or relative to sector averages (if provided >0).
Example for P/B: If relative (sector avg >0), stock P/B < avg * high factor → 15 pts; < avg * med factor → 10 pts; etc.
For ROE/Net Margin (higher is better): Reverse logic (stock > avg / factor).
FCF/EBITDA: Always absolute (normalized thresholds).

Minimum score per metric: 2-5 pts if poor.

Total Score: Sum valid scores, divide by max possible for those metrics, multiply by 100.

Output: Table shows components, values, scores, and sector avgs.
Plot visualizes score with color-coding.
Label categorizes (e.g., "Buffett Approved" for 85+).

User Inputs and Benefits

Thresholds (Absolute/Relative Factors): Customize scoring rules (e.g., change P/E low threshold from 10 to 12).
Benefit: Adapt to personal strategy or market conditions – e.g., stricter for growth stocks.

Manual Sector Averages: Enter averages (e.g., sector P/B = 2.5).
Benefit: Makes scoring industry-specific, reducing bias (e.g., tech's high P/E normal, banking's low ROE risky). If not entered (≤0), falls back to absolute for simplicity.

Color Customizations: Adjust table colors (header, scores).
Benefit: Personalize visuals for dark/light themes, improving readability and user experience.

Normalized FCF/EBITDA Thresholds: Set as % of market cap. Benefit: Size-independent comparison – small caps won't be disadvantaged.

Usage Notes Add to chart via Indicators menu.

Data relies on TradingView fundamentals – may be limited for some exchanges (e.g., BIST, international). Use manual averages for accuracy.
For screener: High request count (10) may exceed limits; use reduced version if needed.
Not financial advice – always verify with external sources.

Feedback welcome – let's improve together!

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.