OPEN-SOURCE SCRIPT
Quality Detector (Buffett Style) + Beta [Solid]

This indicator acts as an on-chart fundamental screener, designed to instantly evaluate the quality and financial health of a company directly on your price chart.
The concept is inspired by "Buffettology" principles: looking for large, profitable companies with low debt. Additionally, it includes a Beta calculation to assess market volatility risk.
The tool displays a panel in the bottom-right corner featuring four key metrics and a final verdict.
How it Works & Metrics Used
The script retrieves quarterly fundamental data ("FQ") and performs calculations to verify if the asset meets specific criteria.
1. Market Cap (Size)
What it is: The total market value of the company's outstanding shares.
Goal: To identify established, large-cap companies.
Default Threshold: Must be greater than $10 Billion.
2. ROE - Return on Equity (Quality)
What it is: A measure of financial performance calculated by dividing net income by shareholders' equity.
Goal: To find companies that are efficient at generating profits from shareholders' capital.
Default Threshold: Must be higher than 15%.
3. Total Debt to Equity (Health)
What it is: A ratio indicating the relative proportion of shareholders' equity and debt used to finance a company's assets.
Calculation: This script manually calculates this ratio by fetching TOTAL_DEBT and dividing it by TOTAL_EQUITY from fundamental data to ensure robustness across different symbols.
Goal: To ensure the company is not overly leveraged.
Default Threshold: Must be lower than 1.5.
4. Beta (Risk/Volatility)
What it is: A measure of a stock's volatility in relation to the overall market (S&P 500).
Calculation: It is calculated by comparing the asset's returns against SPY (S&P 500 ETF) returns over a 252-day period (approx. 1 trading year).
Goal: To understand if the stock is more volatile (Beta > 1) or less volatile (Beta < 1) than the market.
Note: Beta does not affect the final "Quality" score but serves as an extra risk indicator, highlighting in orange if Beta > 1.
The Verdict (Scoring System)
The indicator assigns a score from 0 to 3 based on the first three fundamental metrics (Size, ROE, and Debt/Equity).
If a metric passes the threshold, it gets a green background and +1 point.
If it fails, it gets a red background.
Final Verdict:
💎 QUALITY GEM: The company passed all 3 fundamental checks (Score = 3/3).
⚠️ DISCARD: The company failed one or more fundamental checks.
Settings
You can customize the thresholds to fit your own investment strategy in the indicator settings:
Minimum Market Cap (in Billions).
Minimum ROE (%).
Maximum Debt/Equity Ratio.
Disclaimer: This tool is for informational and educational purposes only. It relies on third-party fundamental data which may sometimes be delayed or unavailable. Do not base investment decisions solely on this indicator.
The concept is inspired by "Buffettology" principles: looking for large, profitable companies with low debt. Additionally, it includes a Beta calculation to assess market volatility risk.
The tool displays a panel in the bottom-right corner featuring four key metrics and a final verdict.
How it Works & Metrics Used
The script retrieves quarterly fundamental data ("FQ") and performs calculations to verify if the asset meets specific criteria.
1. Market Cap (Size)
What it is: The total market value of the company's outstanding shares.
Goal: To identify established, large-cap companies.
Default Threshold: Must be greater than $10 Billion.
2. ROE - Return on Equity (Quality)
What it is: A measure of financial performance calculated by dividing net income by shareholders' equity.
Goal: To find companies that are efficient at generating profits from shareholders' capital.
Default Threshold: Must be higher than 15%.
3. Total Debt to Equity (Health)
What it is: A ratio indicating the relative proportion of shareholders' equity and debt used to finance a company's assets.
Calculation: This script manually calculates this ratio by fetching TOTAL_DEBT and dividing it by TOTAL_EQUITY from fundamental data to ensure robustness across different symbols.
Goal: To ensure the company is not overly leveraged.
Default Threshold: Must be lower than 1.5.
4. Beta (Risk/Volatility)
What it is: A measure of a stock's volatility in relation to the overall market (S&P 500).
Calculation: It is calculated by comparing the asset's returns against SPY (S&P 500 ETF) returns over a 252-day period (approx. 1 trading year).
Goal: To understand if the stock is more volatile (Beta > 1) or less volatile (Beta < 1) than the market.
Note: Beta does not affect the final "Quality" score but serves as an extra risk indicator, highlighting in orange if Beta > 1.
The Verdict (Scoring System)
The indicator assigns a score from 0 to 3 based on the first three fundamental metrics (Size, ROE, and Debt/Equity).
If a metric passes the threshold, it gets a green background and +1 point.
If it fails, it gets a red background.
Final Verdict:
💎 QUALITY GEM: The company passed all 3 fundamental checks (Score = 3/3).
⚠️ DISCARD: The company failed one or more fundamental checks.
Settings
You can customize the thresholds to fit your own investment strategy in the indicator settings:
Minimum Market Cap (in Billions).
Minimum ROE (%).
Maximum Debt/Equity Ratio.
Disclaimer: This tool is for informational and educational purposes only. It relies on third-party fundamental data which may sometimes be delayed or unavailable. Do not base investment decisions solely on this indicator.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.