My next in the series of valuation stock screening strategies is undoubtedly one of my favorites because its the predominant valuation strategy that Warren Buffet uses to pick companies to invest. This is also one of the hardest strategies because the whole premise rests on predicting the future cash flows for a company which is no simple feat. Luckily since none of us are full-time financial analysts I can use some good signals and approximation to calculate this.
In the dynamic world of stock market analysis, the Discounted Cash Flow (DCF) model stands out as a paramount tool for discerning investors. At its core, the DCF model is a valuation method that aims to estimate the intrinsic value of a company’s share. So, how does it work? Imagine you’re peeking into the financial future of a company, assessing all the money it’s going to generate. Now, a dollar today is worth more than a dollar in the future, right?
The DCF model precisely captures this concept.
DCF=∑ CFt/ (1+r)^t,
where CFt represents the cash flow in year t and r is the discount rate, we “discount” future cash flows back to the present value. This summation gives us an aggregate value for all future cash flows. Divide that by the number of outstanding shares, and voilà, you get the fair price of a single share! While the DCF model does demand a deep dive into financial forecasts and a judicious choice of the discount rate, its power in grounding stock prices to fundamental, tangible financials is unparalleled. Armed with DCF, you’re not just speculating; you’re investing with precision and foresight.
What is the concept behind discount rate?
At its essence, the discount rate reflects the idea that a certain amount of money today has a different value than the same amount in the future. This is due to factors like inflation, opportunity costs, and inherent risks. In the Discounted Cash Flow (DCF) model, the discount rate is utilized to bring future cash flows back to their present value.
Fair Share Price=DCF / Outstanding shares
I guess you can see where I am going with this – if the current price of a ticker is less than fair share price then it is undervalued else it is overvalued.
How to calculate cash flow?
Now the hardest part to calculate in this formula is the future cash flows. Im gonna do something clever just extrapolate the previous 3-4 years of cash flow. Obviously this method has many flaws but for folks like us with no hard finance background its a pretty decent first step. Of course, if you are willing to put the time into it, you can pore over the company’s guidances and financial reports to make a better guess.
Since the term ‘cash flow’ is vague the ballpark we are going to use is –
FCF=EBIT(1−Tax rate)+Depreciation
This data is readily available on yfinance API. The full formula to calculate cash flow is
FCF=EBIT(1−tax rate)+Depreciation−Change in Net Working Capital−Capital Expenditures
Now we have all the information lets get into the code –
Code
def get_stock_data(ticker):
data = yf.Ticker(ticker)
current_price = data.info['currentPrice']
industry = data.info['industry']
outstanding_shares = data.info['sharesOutstanding']
return outstanding_shares, current_price, industry
def get_current_cashflow(ticker):
data = yf.Ticker(ticker)
financials = data.financials
ebit = financials.loc['EBIT', financials.columns[1]]
tax_rate = financials.loc['Tax Rate For Calcs', financials.columns[1]]
decpreciation = financials.loc['Reconciled Depreciation', financials.columns[1]]
ebit_2021 = financials.loc['EBIT', financials.columns[2]]
ebit_2020 = financials.loc['EBIT', financials.columns[3]]
print(ebit, ebit_2021, ebit_2020)
growth_rate = ((ebit - ebit_2021)/(ebit) + (ebit_2021 - ebit_2020)/(ebit_2020))/2
return growth_rate, ebit * (1 - tax_rate) + decpreciation
def calculate_10_year_cashflow(growth_rate, discount_rate, cash_flow):
sum = 0
for i in range(10):
sum += cash_flow*math.pow(1+growth_rate, i+1)/math.pow(1 + discount_rate, i+1)
return sum
def calculate_fair_price(ticker, discount_rate = 0.04):
outstanding_shares, current_price, industry = get_stock_data(ticker)
growth_rate, cashflow = get_current_cashflow(ticker)
total_cash_flow = calculate_10_year_cashflow(growth_rate, discount_rate, cashflow)
return current_price, total_cash_flow/outstanding_shares
What is evident here is that we have been pretty liberal with our assumption of future cash flow value. The more important thing here are the concepts and the understanding behind how discounted cash flow valuation works. If you put the time into understanding it, this is an extremely powerful tool at your disposal.
Happy investing
Leave a comment