Stock's Intrinsic Value| DCF modelScript Description
This pine script is based on a YouTube video titled: Warren Buffett: How to Calculate the Intrinsic Value of a Stock. Warren Buffett is a famous value investor who follows the principles of his mentor Benjamin Graham. He looks for companies that have strong competitive advantages, consistent earnings, and low debt. He also considers the intrinsic value of a company, which is the present value of its future cash flows, and compares it to the market price. He prefers to buy stocks that are trading below their intrinsic value and hold them for a long time.
One of the methods that Buffett uses to estimate the intrinsic value of a company is the discounted cash flow (DCF) model. This involves projecting the free cash flow (FCF) of the company for several years and then discounting it back to the present using an appropriate discount rate. The discount rate is usually the weighted average cost of capital (WACC) of the company, which reflects its cost of equity and debt. The sum of the discounted FCFs and terminal value is the intrinsic value of the company.
Lastly, a margin of safety is included when using the DCF method for stock valuation because of uncertainty and error in estimating future cash flows and the intrinsic value of the company.
When the current price is below margin of safety, it means that the stock is currently undervalued and being price at significantly below its intrinsic value.
Guideline for determining each variable in this script
FCF growth rate: This is the annual rate at which the free cash flow (FCF) of the company is expected to grow over a forecast 10-year period. You can use historical FCF growth rates, industry averages, analyst estimates, or your assumptions to project the FCF growth rate. The higher the FCF growth rate, the higher the intrinsic value will be.
Discount rate: This is the rate of return that you require to invest in the company. It reflects the risk and opportunity cost of investing in the company. You can use the weighted average cost of capital (WACC) of the company, capital pricing model (CAPM), hurdle rate, or market rate as the discount rate. The lower the discount rate, the higher the intrinsic value.
The margin of safety: Provides a cushion against errors in the valuation or adverse events that may affect the company. The margin of safety depends on your personal preference and risk tolerance. Normally is at 15% - 30%, the higher the margin of safety you set, the lower the chance that the stock will hit that level.
How to use this script
Step 1: This script only works for stocks that have financial data of free cash flow and total common shares outstanding
Step 2: Please use a yearly chart (12-month chart)
Step 3: You are required to determine a growth rate that will grow the free cash flow 10 years into the future
Step 4: You are required to determine a discount rate for the calculations
Step 5: You are required to add a margin of safety (Accounting for uncertainty)
Step 6: The rest of the calculations will be done automatically.
Disclaimer when using this script
I'm not a financial advisor
This script is for education purposes only
There are risks involved with stock market investing and investors should not act upon the content or information found here without first seeking advice from an accountant, financial planner, lawyer or other professional.
I can’t guarantee that this script will be error-free as I still consider myself a Pinescript beginner
Before making any decisions, investors should always research companies individually
I'll not be liable for any loss incurred, arising from the use of, or reliance on, this script
Limitations of this script
This script only works on the yearly chart (12 monthly charts)
The intrinsic value of a company will be negative if the company have a negative forecasted free cash flow
You need to make an educated guess about the growth rate, discount rate and margin of safety
This script uses free cash flow instead of owner's earnings (Operating cash flow - Maintenance capital expenditure), therefore it can't accurately estimate the maintenance capital expenditure.
Need at least 6 years’ worth of financial data
Market capitalisation uses total common shares outstanding multiplied by the closing price instead of using company-level total outstanding shares multiplied by the closing price
DCF
SFC Valuation Model - Fair ValueValuation is the analytical process of determining the current (or projected) worth of an asset or a company. There are many techniques used for doing a valuation. An analyst placing a value on a company looks at the business's management, the composition of its capital structure, the prospect of future earnings, and the market value of its assets, among other metrics.
Fundamental analysis is often employed in valuation, although several other methods may be employed such as the capital asset pricing model (CAPM) or the dividend discount model (DDM), Discounted Cash Flow (DCF) and many others.
A valuation can be useful when trying to determine the fair value of a security, which is determined by what a buyer is willing to pay a seller, assuming both parties enter the transaction willingly. When a security trades on an exchange, buyers and sellers determine the market value of a stock or bond.
There is no universal standard for calculating the intrinsic value of a company or stock. Financial analysts attempt to determine an asset's intrinsic value by using fundamental and technical analyses to gauge its actual financial performance.
Intrinsic value is useful because it can help an investor understand whether a potential investment is overvalued or undervalued.
This indicator allows investors to simulate different scenarios depending on their view of the stock's value. It calculates different models automatically, but users can define the fair value manually by changing the settings.
For example: change the weight of the model; choose how conservatively want to evaluate the stock; use different growth rate or discount rate and so on.
The indicator shows other useful metrics in order to help investors to evaluate the stock.
This indicator can save users hours of searching financial data and calculating fair value.
There are few valuation methods/steps
- Macroeconomics - analyse the current economic;
- Define how the sector is performing;
- Relative valuation method - compare few stocks and find the Outlier;
- Absolute valuation method historically- define how the stock performed in the past;
- Absolute valuation method - define how the stock is performed now and find the fair value;
- Technical analysis
How to use:
1. Once you have completed the initial evaluation steps, simply load the indicator.
2. Check the default settings and see if they suit you.
3. Find the fair value and wait for the stock to reach it.
DCF ApproximationThe indicator for calculating and visualizing the Discounted Cash Flow (DCF) for a selected stock.
It uses the Weighted Average Cost of Capital (WACC) with a margin of safety and the Free Cash Flow (FCF) calculation for cash flow analysis. The DCF is calculated by summing the discounted annual FCFs over a 10-year period.
The chart color depends on the value of the current price percentage - it turns red when the market price is over valuation, yellow around a fair value, and green for the price under valuation.
This is an early version of the indicator, so I would appreciate your suggestions for improving the code and formulas.
Market Beta/Beta Coefficient for CAPM [Loxx]Market Beta/Beta Coefficient for CAPM is not so much an indicator as it is a value to be used in future indicators to forecast stock prices using the Capital Asset Pricing Model, CAPM. CAPM is used by the likes of value investors such as Warren Buffet and valuation/accounting/investment banking firms. More specifically, CAPM is typically used in Discounted Cashflow Analysis to value revenue generating assets.
What is Beta?
In finance, the beta (β or market beta or beta coefficient) is a measure of how an individual asset moves (on average) when the overall stock market increases or decreases. Thus, beta is a useful measure of the contribution of an individual asset to the risk of the market portfolio when it is added in small quantity. Thus, beta is referred to as an asset's non-diversifiable risk, its systematic risk, market risk, or hedge ratio. Beta is not a measure of idiosyncratic risk.
By definition, the value-weighted average of all market-betas of all investable assets with respect to the value-weighted market index is 1. If an asset has a beta above (below) 1, it indicates that its return moves more (less) than 1-to-1 with the return of the market-portfolio, on average. In practice, few stocks have negative betas (tending to go up when the market goes down). Most stocks have betas between 0 and 3.
How to calculate Beta
To calculate beta you typically choose 5 years of monthly data; typically SPY is used here
Calculate log returns of both the asset for which you are calculating Beta and the benchmark market data
Calculation the covariance between the asset and benchmark
Calculate the variance of the benchmark returns
Divide the covariance by the variance
Read more here:
en.wikipedia.org(finance)
en.wikipedia.org
einvestingforbeginners.com
Valuation Scenarios by Filipe RamosEnglish:
An indicator that allows you to project a scenario of fair value of a stock considering expected revenue growth and net margin in a DCF model. Rather than forecast what should be the price of a stock, this indicator calculates possible scenarios accordingly to expected growth and value added the user inputs. It has 3 parameters:
-Years: the timeframe of projected present value;
-Revenue yearly growth percentage: minimum value is 1.1 (represents 10% annual growth but with the discount rate of 10% means no growth at all);
-Margin: the net margin.
It projects a linear growth and an exponential growth.
DCF ValuationAn indicator that can be used to study Discounted Cash Flow Valuation for stocks.
When the reported Free Cash Flow for a company is non-positive the line turns gray. Red color means the market price is higher than the valuation whereas green color means the market price is below the valuation and it might be a good opportunity for value traders.