OPEN-SOURCE SCRIPT

Financials Score All

Description of the "Financials Score All" Script
This Pine Script calculates a financial score for a specific stock, based on various financial metrics. The purpose is to provide a comprehensive numerical score that reflects the financial health of the stock. The score is calculated using multiple financial indicators, including profitability, valuation, debt management, and liquidity. Here’s a breakdown of what each part of the script does:

period = input.string('FQ', 'Period', options=['FQ', 'FY'])
FQ refers to Quarterly financial data.
FY refers to Fiscal Year financial data.
Financial Metrics:
The script uses various financial metrics to calculate the score. These are obtained via request.financial, which retrieves financial data for the stock from TradingView's database. Below are the metrics used:

opmar (Operating Margin): Measures the company's profitability as a percentage of revenue.
eps (Earnings Per Share): Represents the portion of a company's profit allocated to each outstanding share.
eps_ttm (Earnings Per Share – Trailing Twelve Months): EPS over the most recent 12 months.
pe_ratio (Price-to-Earnings Ratio): A measure of the price investors are willing to pay for a stock relative to its earnings.
pb_ratio (Price-to-Book Ratio): A valuation ratio comparing a company’s market value to its book value.
de_ratio (Debt-to-Equity Ratio): A measure of the company’s financial leverage, showing how much debt it has compared to shareholders' equity.
roe_pb (Return on Equity Adjusted to Book): Measures the company's profitability relative to its book value.
fcf_per_share (Free Cash Flow per Share): Represents the free cash flow available for dividends, debt reduction, or reinvestment, per share.
pfcf_ratio (Price-to-Free-Cash-Flow Ratio): A measure comparing a company’s market value to its free cash flow.
current_ratio (Current Ratio): A liquidity ratio that measures a company's ability to pay short-term obligations with its current assets.
RSI Calculation:
The script calculates the Relative Strength Index (RSI) for the stock using an 8-period lookback:
rsi = ta.rsi(close, 8)

Score Calculation:
The script calculates a total score by adding points based on the values of the financial metrics. Each metric is checked against a condition, and if the condition is met, the score is incremented:

If the Operating Margin (opmar) is greater than 20, the score is incremented by 20 points.
If Earnings Per Share (EPS) is positive, 10 points are added.
If the P/E ratio is between 0 and 20, 10 points are added.
If the P/B ratio is less than 3, 10 points are added.
If the Debt-to-Equity ratio is less than 0.8, 10 points are added.
If the Return on Equity Adjusted to Book is greater than 10, 10 points are added.
If the P/FCF ratio is between 0 and 15, 10 points are added.
If the Current Ratio is greater than 1.61, 10 points are added.
If the RSI is less than 35, 10 points are added.
The score is accumulated based on these conditions and stored in the total_score variable.

Displaying the Total Score:
Finally, the total score is plotted on the chart:

Summary of How It Works:
This script calculates a financial score for a stock using a variety of financial indicators. Each metric has a threshold, and when the stock meets certain criteria (for example, a good operating margin, a healthy debt-to-equity ratio, or a low P/E ratio), points are added to the overall score. The result is a single numerical value that reflects the financial health of the stock.

This score can help traders or investors identify companies with strong financials, or serve as a comparison tool between different stocks based on their financial health.

Generally >60 is the best stocks for med and long term trades
Fundamental Analysis

Script open-source

In pieno spirito TradingView, l'autore di questo script lo ha pubblicato open-source, in modo che i trader possano comprenderlo e verificarlo. Un saluto all'autore! È possibile utilizzarlo gratuitamente, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?

Declinazione di responsabilità