Discounted Cash Flow with Python – Valuing a Company

During this post, we are going to use the discounted cash flow method with Python to value a company. The DCF model that we will build is going to be dynamic. That is, we will be able to reuse it for any company that we want to estimate the stock price for.

Discounted Cash Flow with Python
Photo by Asdii Wang from Pexels

Introduction to the Discounted Cash Flow Method

The majority of valuation methods are based on net income. We have already seen a few of them in my previous posts, such as, price earnings with Python and the net current asset value per share among others. The discounted cash flow method is different. It focus on company’s future abilities to generate cash.

Cash is what the firm needs in order to be able to pay bills, taxes, salaries and also to pay back to the company capital providers.

The company reported cash flow statements splits company activities into three parts. Investment activities, financing activities and operating activities. For the discounted cash flow method, we will mainly focus on the operating cash flow. Operating cash flow reflects all cash in and outflows related to the production and sale of the company goods and services.

Cash flow statement is important because we are not able to know how much cash a company generates simply by looking into the income statement or balance sheet. For example, take net income. By looking into net income, we are not able to know how much cash a company has generated. Net income is contaminated by non-cash items such as depreciation, sales on credit, etc.

Therefore, since the discounted cash flow method is based on cash, we will start our model with net income and we will adjust certain items to get the operating cash flow of the firm:

  • Non-cash revenues and expenses which are related to operations.
  • Adjust for other operating items that have led to an outflow or inflow of cash such as the collection of accounts receivables or payment of accounts payables.

Then, once we have operating cash flow, we can simply deduct capital expenditures to get to the free cash flow (FCF) of the company. This is what we will use to estimate the value of a company.

Net Income 
 + Depreciation
Increase in Accounts Receivable (-)
Increase in Inventory (-)
Increase in other assets (-)
Increase in Accounts Payable (+)
Incrase in ohter liabilities (+)
Operating Cash Flow
– Purchases of equipment or Capital Expenditures
Free Cash Flow
Free Cash Flow of a Company

We could also add back interest payments after taxes because interest is a financing item. However, to keep it simple, we will not deduct interest payments from net income in our model.

We add depreciation back to net income because it is not a cash-expense. Finally, we subtract the change in the net working capital to get to our operating cash flow.

Operating cash flow lets us know how much a company has generated from operations.

Now, we can get to the company free cash flow by subtracting investments (i.e. the capital expenditures performed by the company).

Free cash flow is what we need in the DCF method in order to estimate the value of the company. As per the discounted cash flow method, we can get the firm value by applying below formula.

source: https://biostrategyanalytics.com/2013/06/17/valuation-of-pharmaceutical-and-biotechnology-companies-dcf-part-1/

Where FCFF is the Firm Cash Flow and TV is the terminal value. We have already seen how to get the free cash flow of a firm. Below, we will also find out how to calculate the terminal value.

Forecasting Company’s Free Cash Flow

The DCF method requires to forecast the free cash flow for the next few years. In our model, we will forecast the next 5 years.

We will use the percentage of sales method to forecast a company cash flow. We will estimate future sales of the company and estimate the required income statement and balance sheet items based on the percentage of sales.

For example, company A in the past had a cost of goods that represented 30% of the sales. Therefore, using the percentage of sales method, we could assume that in the next year income statement forecast, COGS will remain 30% of the sales.

To sum up, we will follow the following steps to value a company using the discounted cash flow (DCF) method with Python:

  1. Estimate revenue growth. For simplicity, we will calculate last year revenue growth and assume that the revenue growth will be the same each year for the forecasted years. A better approach would be to find peer companies to help us understand how much sales could growth over time and how mature the industry is. Based on this, we could estimate revenue growth for the forecasted periods.
  2. Represent company’s balance sheets and income statement in common size as a percentage of sales.
  3. Based on the common size statements, forecast the income statement, balance sheet and cash flow statement for the next 5 years.
  4. Calculate the cost of capital WACC (Have a look at my previous post to know how to calculate WACC with Python).
  5. Use WACC as a discount rate to calculate the net present value of the free cash flow for the 5 forecasted years.
  6. Calculate the terminal value of the company. That is the value of the company after the 5 forecasted years. The terminal value is required since we have only forecasted the next five years of the company cash flows. What happen after this 5 years? We estimate the firm’s terminal value.
  7. Calculate the target value of equity and the total debt of the company. Finally, compute the target stock price.

In the next section, we will move to Python to start creating our model.

Discounted Cash Flow with Python

Time to start with the fun part. The idea is to build a discounted cash flow model with Python. We will pass the ticker of the company that we want to estimate the stock price for and have Python doing the hard work for us. Then, the outcome of the code will be an estimated stock price and the assumptions that we have used to come up with the that target price.

To use the discounted cash flow method, we need to retrieve some company financials. We will need to retrieve the most recent company balance sheet and income statement. We will use them to build our model.

To request the financials, we are going to use financialmodelingprep API, a financial API offering up to 250 free requests per month. If 250 requests are not enough, you can get a yearly subscription for a bit less than $130. Financialmodelingprep offers a 25% discount to all readers of codingandfun by using this link.

Since the code is a bit long, I will split it by sections. The outcome of the code will be the estimated Google stock price using the discounted cash flow method.

A. Estimating Future Revenue Growth

As discussed above, estimating how much the revenue is going to growth for the next five years is the key for the DCF valuation. We will keep it simple and assume that the company revenue is going to keep growing by the same percentage that in the last year.

(Note: In below code, remember to replace the value of the variable demo by your api key from financialmodelingprep).

We extract Google income statement for the last three years. Then, we calculate the revenue variation of the last year and store it in a variable called revenue_g:

import requests
import numpy as np
import pandas as pd

company = 'GOOG'
demo = 'your api key
IS = requests.get(f'https://financialmodelingprep.com/api/v3/income-statement/{company}?apikey={demo}').json()
count = 0
#get revenue growth to estimate future sales
revenue_g = []
for item in IS:
  if count < 4:
    #print(item)
    revenue_g.append(item['revenue'])
    count = count + 1

revenue_g = (revenue_g[0] - revenue_g[1]) /revenue_g[1] 
print(revenue_g)
#ouctome
0.15469210475913925

As shown above, Google revenue has grown by 15.46% in the last year. That will be our yearly revenue growth assumption for the forecasted 5 years. Feel free to manually change the code to provide a different growth estimation.

B. Retrieving Income Statement and Balance Sheet

Next, we get the income statement and balance sheet.

First, we calculate the full income statement as a percentage of the revenue. Then, we forecast the next 5 year income statement by multiplying the revenue of the previous year times the revenue_g calculated in section A. Having done that, we can multiply each of the income statement items by the % of revenue to get a full income statement.

We do the same for the balance sheet. Where we also show it as a percentage of the revenue and forecast the next 5 years:

#Get net income
net_income = IS[0]['netIncome']

BS = requests.get(f'https://financialmodelingprep.com/api/v3/balance-sheet-statement/{company}?apikey={demo}').json()

#get income statement as % of revenue for future predictions and forecast 5 next IS years
income_statement = pd.DataFrame.from_dict(IS[0],orient='index')
#The [5:26] below get rids of not needed items coming from the API
income_statement = income_statement[5:26]
income_statement.columns = ['current_year']
income_statement['as_%_of_revenue'] = income_statement / income_statement.iloc[0]

#forecasting 5 next years income statement
income_statement['next_year'] =  (income_statement['current_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_2_year'] =  (income_statement['next_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_3_year'] =  (income_statement['next_2_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_4_year'] =  (income_statement['next_3_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_5_year'] =  (income_statement['next_4_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 

#Get Balance sheet as a percentage of revenue
balance_sheet = pd.DataFrame.from_dict(BS[0],orient='index')
balance_sheet = balance_sheet[5:-2]
balance_sheet.columns = ['current_year']
balance_sheet['as_%_of_revenue'] = balance_sheet / income_statement['current_year'].iloc[0]

#forecasting the next 5 years Balance Sheet.
balance_sheet['next_year'] =  income_statement['next_year'] ['revenue'] * balance_sheet['as_%_of_revenue']
balance_sheet['next_2_year'] =  income_statement['next_2_year'] ['revenue'] * balance_sheet['as_%_of_revenue']
balance_sheet['next_3_year'] =  income_statement['next_3_year']['revenue'] * balance_sheet['as_%_of_revenue'] 
balance_sheet['next_4_year'] =  income_statement['next_4_year']['revenue']  * balance_sheet['as_%_of_revenue'] 
balance_sheet['next_5_year'] =  income_statement['next_5_year']['revenue'] * balance_sheet['as_%_of_revenue']

C. Forecasting Future Cash Flow From Operations

Finally, we have enough information in order to estimate the next five year cash flows for Google.

Do not get scared by the amount of lines in below piece of code. It is just repeating itself to forecast the cash flow for each of the five years. In below paragraph, I explain what the code does.

We create an empty dictionary where we will add each of the 5 years that we are going to forecast. Then, we start by getting the net income for the year. Next, we get the increase of depreciation, receivables, payables and inventories.

Having these elements, we can compute the cash flow from operations. Then, we calculate the CAPEX for the year by calculating the change in Property Plan and Equipment (PP&E) and adding depreciation.

Finally, we add cash flow from operations and CAPEX to estimate the free cash flow for the first year that we need for the DCF model. Then, we repeat 4 times more the same code in order to forecast the next 4 years.

CF_forecast = {}
CF_forecast['next_year'] = {}
CF_forecast['next_year']['netIncome'] = income_statement['next_year']['netIncome']
CF_forecast['next_year']['inc_depreciation'] = income_statement['next_year']['depreciationAndAmortization']
CF_forecast['next_year']['inc_receivables'] = balance_sheet['next_year']['netReceivables'] - balance_sheet['current_year']['netReceivables']
CF_forecast['next_year']['inc_inventory'] = balance_sheet['next_year']['inventory'] - balance_sheet['current_year']['inventory']
CF_forecast['next_year']['inc_payables'] = balance_sheet['next_year']['accountPayables'] - balance_sheet['current_year']['accountPayables']
CF_forecast['next_year']['CF_operations'] = CF_forecast['next_year']['netIncome'] + CF_forecast['next_year']['inc_depreciation'] + (CF_forecast['next_year']['inc_receivables'] * -1) + (CF_forecast['next_year']['inc_inventory'] *-1) + CF_forecast['next_year']['inc_payables']
CF_forecast['next_year']['CAPEX'] = balance_sheet['next_year']['propertyPlantEquipmentNet'] - balance_sheet['current_year']['propertyPlantEquipmentNet'] + income_statement['next_year']['depreciationAndAmortization']

CF_forecast['next_year']['FCF'] = CF_forecast['next_year']['CAPEX'] + CF_forecast['next_year']['CF_operations']


CF_forecast['next_2_year'] = {}
CF_forecast['next_2_year']['netIncome'] = income_statement['next_2_year']['netIncome']

CF_forecast['next_2_year']['inc_depreciation'] = income_statement['next_2_year']['depreciationAndAmortization']
CF_forecast['next_2_year']['inc_receivables'] = balance_sheet['next_2_year']['netReceivables'] - balance_sheet['next_year']['netReceivables']
CF_forecast['next_2_year']['inc_inventory'] = balance_sheet['next_2_year']['inventory'] - balance_sheet['next_year']['inventory']
CF_forecast['next_2_year']['inc_payables'] = balance_sheet['next_2_year']['accountPayables'] - balance_sheet['next_year']['accountPayables']
CF_forecast['next_2_year']['CF_operations'] = CF_forecast['next_2_year']['netIncome'] + CF_forecast['next_2_year']['inc_depreciation'] + (CF_forecast['next_2_year']['inc_receivables'] * -1) + (CF_forecast['next_2_year']['inc_inventory'] *-1) + CF_forecast['next_2_year']['inc_payables']
CF_forecast['next_2_year']['CAPEX'] = balance_sheet['next_2_year']['propertyPlantEquipmentNet'] - balance_sheet['next_year']['propertyPlantEquipmentNet'] + income_statement['next_2_year']['depreciationAndAmortization']
CF_forecast['next_2_year']['FCF'] = CF_forecast['next_2_year']['CAPEX'] + CF_forecast['next_2_year']['CF_operations']


CF_forecast['next_3_year'] = {}
CF_forecast['next_3_year']['netIncome'] = income_statement['next_3_year']['netIncome']

CF_forecast['next_3_year']['inc_depreciation'] = income_statement['next_3_year']['depreciationAndAmortization'] 
CF_forecast['next_3_year']['inc_receivables'] = balance_sheet['next_3_year']['netReceivables'] - balance_sheet['next_2_year']['netReceivables']
CF_forecast['next_3_year']['inc_inventory'] = balance_sheet['next_3_year']['inventory'] - balance_sheet['next_2_year']['inventory']
CF_forecast['next_3_year']['inc_payables'] = balance_sheet['next_3_year']['accountPayables'] - balance_sheet['next_2_year']['accountPayables']
CF_forecast['next_3_year']['CF_operations'] = CF_forecast['next_3_year']['netIncome'] + CF_forecast['next_3_year']['inc_depreciation'] + (CF_forecast['next_3_year']['inc_receivables'] * -1) + (CF_forecast['next_3_year']['inc_inventory'] *-1) + CF_forecast['next_3_year']['inc_payables']
CF_forecast['next_3_year']['CAPEX'] = balance_sheet['next_3_year']['propertyPlantEquipmentNet'] - balance_sheet['next_2_year']['propertyPlantEquipmentNet'] + income_statement['next_3_year']['depreciationAndAmortization']
CF_forecast['next_3_year']['FCF'] = CF_forecast['next_3_year']['CAPEX'] + CF_forecast['next_3_year']['CF_operations']


CF_forecast['next_4_year'] = {}
CF_forecast['next_4_year']['netIncome'] = income_statement['next_4_year']['netIncome']

CF_forecast['next_4_year']['inc_depreciation'] = income_statement['next_4_year']['depreciationAndAmortization']
CF_forecast['next_4_year']['inc_receivables'] = balance_sheet['next_4_year']['netReceivables'] - balance_sheet['next_3_year']['netReceivables']
CF_forecast['next_4_year']['inc_inventory'] = balance_sheet['next_4_year']['inventory'] - balance_sheet['next_3_year']['inventory']
CF_forecast['next_4_year']['inc_payables'] = balance_sheet['next_4_year']['accountPayables'] - balance_sheet['next_3_year']['accountPayables']
CF_forecast['next_4_year']['CF_operations'] = CF_forecast['next_4_year']['netIncome'] + CF_forecast['next_4_year']['inc_depreciation'] + (CF_forecast['next_4_year']['inc_receivables'] * -1) + (CF_forecast['next_4_year']['inc_inventory'] *-1) + CF_forecast['next_4_year']['inc_payables']
CF_forecast['next_4_year']['CAPEX'] = balance_sheet['next_4_year']['propertyPlantEquipmentNet'] - balance_sheet['next_3_year']['propertyPlantEquipmentNet'] + income_statement['next_4_year']['depreciationAndAmortization']
CF_forecast['next_4_year']['FCF'] = CF_forecast['next_4_year']['CAPEX'] + CF_forecast['next_4_year']['CF_operations']

CF_forecast['next_5_year'] = {}
CF_forecast['next_5_year']['netIncome'] = income_statement['next_5_year']['netIncome']

CF_forecast['next_5_year']['inc_depreciation'] = income_statement['next_5_year']['depreciationAndAmortization'] 
CF_forecast['next_5_year']['inc_receivables'] = balance_sheet['next_5_year']['netReceivables'] - balance_sheet['next_4_year']['netReceivables']
CF_forecast['next_5_year']['inc_inventory'] = balance_sheet['next_5_year']['inventory'] - balance_sheet['next_4_year']['inventory']
CF_forecast['next_5_year']['inc_payables'] = balance_sheet['next_5_year']['accountPayables'] - balance_sheet['next_4_year']['accountPayables']
CF_forecast['next_5_year']['CF_operations'] = CF_forecast['next_5_year']['netIncome'] + CF_forecast['next_5_year']['inc_depreciation'] + (CF_forecast['next_5_year']['inc_receivables'] * -1) + (CF_forecast['next_5_year']['inc_inventory'] *-1) + CF_forecast['next_5_year']['inc_payables']
CF_forecast['next_5_year']['CAPEX'] = balance_sheet['next_5_year']['propertyPlantEquipmentNet'] - balance_sheet['next_4_year']['propertyPlantEquipmentNet'] + income_statement['next_5_year']['depreciationAndAmortization']
CF_forecast['next_5_year']['FCF'] = CF_forecast['next_5_year']['CAPEX'] + CF_forecast['next_5_year']['CF_operations']

D. Convert the Forecasted Free Cash Flows into a Pandas

#add the forecasted cash flows into a Pandas
CF_forec = pd.DataFrame.from_dict(CF_forecast,orient='columns')

#add below option to format the dataframe with thousand separators
pd.options.display.float_format = '{:,.0f}'.format

print(CF_forec)
Discounted Cash Flow Method with Python
Forecasting cash flows with Python

E. Estimating the Cost of Capital

For discounting the forecasted free cash flows (FCF), we will use the company WACC. Therefore, we need to estimate the average weighted cost of capital (WACC) for the firm. This is exactly, what we did in my previous post. Therefore, I will simply provide the code to calculate the WACC for the firm. To understand better how to calculate the WACC with python, refer to my previous post.

import pandas_datareader.data as web
import datetime
import requests


demo = 'your api key'
#Interest coverage ratio = EBIT / interest expenses

def interest_coveraga_and_RF(company):
  IS= requests.get(f'https://financialmodelingprep.com/api/v3/income-statement/{company}?apikey={demo}').json()
  EBIT= IS[0]['ebitda'] - IS[0]['depreciationAndAmortization'] 
  interest_expense = IS[0]['interestExpense']
  interest_coverage_ratio = EBIT / interest_expense

    #RF
  start = datetime.datetime(2019, 7, 10)
        
  end= datetime.datetime.today().strftime('%Y-%m-%d')
  #end = datetime.datetime(2020, 7, 10)

  Treasury = web.DataReader(['TB1YR'], 'fred', start, end)
  RF = float(Treasury.iloc[-1])
  RF = RF/100
  return [RF,interest_coverage_ratio]
  
#Cost of debt
def cost_of_debt(company, RF,interest_coverage_ratio):
  if interest_coverage_ratio > 8.5:
    #Rating is AAA
    credit_spread = 0.0063
  if (interest_coverage_ratio > 6.5) & (interest_coverage_ratio <= 8.5):
    #Rating is AA
    credit_spread = 0.0078
  if (interest_coverage_ratio > 5.5) & (interest_coverage_ratio <=  6.5):
    #Rating is A+
    credit_spread = 0.0098
  if (interest_coverage_ratio > 4.25) & (interest_coverage_ratio <=  5.49):
    #Rating is A
    credit_spread = 0.0108
  if (interest_coverage_ratio > 3) & (interest_coverage_ratio <=  4.25):
    #Rating is A-
    credit_spread = 0.0122
  if (interest_coverage_ratio > 2.5) & (interest_coverage_ratio <=  3):
    #Rating is BBB
    credit_spread = 0.0156
  if (interest_coverage_ratio > 2.25) & (interest_coverage_ratio <=  2.5):
    #Rating is BB+
    credit_spread = 0.02
  if (interest_coverage_ratio > 2) & (interest_coverage_ratio <=  2.25):
    #Rating is BB
    credit_spread = 0.0240
  if (interest_coverage_ratio > 1.75) & (interest_coverage_ratio <=  2):
    #Rating is B+
    credit_spread = 0.0351
  if (interest_coverage_ratio > 1.5) & (interest_coverage_ratio <=  1.75):
    #Rating is B
    credit_spread = 0.0421
  if (interest_coverage_ratio > 1.25) & (interest_coverage_ratio <=  1.5):
    #Rating is B-
    credit_spread = 0.0515
  if (interest_coverage_ratio > 0.8) & (interest_coverage_ratio <=  1.25):
    #Rating is CCC
    credit_spread = 0.0820
  if (interest_coverage_ratio > 0.65) & (interest_coverage_ratio <=  0.8):
    #Rating is CC
    credit_spread = 0.0864
  if (interest_coverage_ratio > 0.2) & (interest_coverage_ratio <=  0.65):
    #Rating is C
    credit_spread = 0.1134
  if interest_coverage_ratio <=  0.2:
    #Rating is D
    credit_spread = 0.1512
  
  cost_of_debt = RF + credit_spread
  return cost_of_debt


def costofequity(company):


  #RF
  start = datetime.datetime(2019, 7, 10)
  end= datetime.datetime.today().strftime('%Y-%m-%d')
  #end = datetime.datetime(2020, 7, 10)

  Treasury = web.DataReader(['TB1YR'], 'fred', start, end)
  RF = float(Treasury.iloc[-1])
  RF = RF/100

#Beta

  beta = requests.get(f'https://financialmodelingprep.com/api/v3/company/profile/{company}?apikey={demo}')
  beta = beta.json()
  beta = float(beta['profile']['beta'])


  #Market Return
  start = datetime.datetime(2019, 7, 10)
  end= datetime.datetime.today().strftime('%Y-%m-%d')

  SP500 = web.DataReader(['sp500'], 'fred', start, end)
      #Drop all Not a number values using drop method.
  SP500.dropna(inplace = True)

  SP500yearlyreturn = (SP500['sp500'].iloc[-1]/ SP500['sp500'].iloc[-252])-1
    
  cost_of_equity = RF+(beta*(SP500yearlyreturn - RF))
  return cost_of_equity

#effective tax rate and capital structure
def wacc(company):
  FR = requests.get(f'https://financialmodelingprep.com/api/v3/ratios/{company}?apikey={demo}').json()

  ETR = FR[0]['effectiveTaxRate']

# 
  BS = requests.get(f'https://financialmodelingprep.com/api/v3/balance-sheet-statement/{company}?period=quarter&apikey={demo}').json()



  Debt_to = BS[0]['totalDebt'] / (BS[0]['totalDebt'] + BS[0]['totalStockholdersEquity'])
  equity_to = BS[0]['totalStockholdersEquity'] / (BS[0]['totalDebt'] + BS[0]['totalStockholdersEquity'])

  WACC = (kd*(1-ETR)*Debt_to) + (ke*equity_to)
  return WACC

RF_and_IntCov = interest_coveraga_and_RF(company)
RF = RF_and_IntCov[0]
interest_coverage_ratio = RF_and_IntCov[1]
ke = costofequity(company)
kd = cost_of_debt(company,RF,interest_coverage_ratio)
wacc_company = wacc(company)
print('wacc of ' + company + ' is ' + str((wacc_company*100))+'%')

F. Getting the Net Present Value of the Forecasted Free Cash Flows

Now that we have the WACC of Google and the forecasted free cash flows for the next five years, we can discount them to know the present value. We can use numpy npv method to do so:

#FCF List of CFs for each year
FCF_List = CF_forec.iloc[-1].values.tolist()
npv = np.npv(wacc_company,FCF_List)

G. Calculating the Terminal Value

The net present value obtained in the section F covers only the next 5 years of the company cash flows. But what happen after these forecasted years?

We need to calculate the terminal value of the company. The terminal value captures the value of the company after the forecasting period. The terminal value will constitute at least 50% of the forecasted value. Therefore, it is super important to pay attention to the assumptions that we make here. Below is the formula we will use:

Discounted Cash Flow - Terminal Value
Discounted Cash Flow – Terminal Value

FCFFn will be the last year of the forecasted free cash flows. Then, we need to come up with a perpetuity growth rate g. The perpetuity rate is the constant rate that a firm is expected to grow at forever.

We will assume 2% perpetuity rate since it is a common practice to be in line with the long-term inflation rate which is usually around 2%. Then, we discount the value using the WACC rate.

#Terminal value
LTGrowth = 0.02

Terminal_value = (CF_forecast['next_5_year']['FCF'] * (1+ LTGrowth)) /(wacc_company  - LTGrowth)

Terminal_value_Discounted = Terminal_value/(1+wacc_company)**4
Terminal_value_Discounted

H. Calculating Google Target Price

Finally, we have all what we need to value a company using the discounted cash flow method and Python. We get the target equity value, the debt of the company and the number of shares.

Then, to estimate the value of the company, simply divide the target value by the number of shares:

target_equity_value = Terminal_value_Discounted + npv
debt = balance_sheet['current_year']['totalDebt']
target_value = target_equity_value - debt
numbre_of_shares = requests.get(f'https://financialmodelingprep.com/api/v3/enterprise-values/{company}?apikey={demo}').json()
numbre_of_shares = numbre_of_shares[0]['numberOfShares']

target_price_per_share = target_value/numbre_of_shares
target_price_per_share

print(company + ' forecasted price per stock is ' + str(target_price_per_share) )
print('the forecast is based on the following assumptions: '+ 'revenue growth: ' + str(revenue_g) + ' Cost of Capital: ' + str(wacc_company) )
print('perpetuity growth: ' + str(LTGrowth)  )

#outcome
GOOG forecasted price per stock is 4828.474984873333
the forecast is based on the following assumptions: revenue growth: 0.15469210475913925 Cost of Capital: 0.07348998226517206
perpetuity growth: 0.02

Wrapping Up

And….magic, our model estimates that the value of Google based on the discounted cash flow method is $4,828 per stock. A bit too high compared to the $1,516 that is trading at today. No wonder, since we are assuming that Google revenue is going to growth 15% per year, which may be too optimistic.

Some of the challenges with the DCF model is the amount of estimations that we need to perform. We need to estimate how much the company is going to growth. If we get that wrong, our model will not give good results.

For example, change manually the revenue_g variable to only 5% (i.e. the revenue growth of the firm). Then, the company value is reduced almost by 50% to only $2,638 per stock.

It is a good practice to estimate three scenarios for the revenue growth values. One with an optimistic outlook (e.g. higher growth than in the past), one with a likely outlook (e.g. same growth than in the past) and a pessimistic outlook (e.g. lower growth than in the past). Then get the average of the three scenarios to get to your estimated value.

Also, the terminal value accounts for more than 50% of the estimated value. If we assumed a wrong perpetuity rate, our model will be off.

Feel free to challenge any of the assumptions used in the model in the comments below. Thanks for reading my blog on Python for Finance!

See the link below for the video tutorial version of this post:

Below is the whole code for your reference:

import requests
import numpy as np
import pandas as pd

company = 'GOOG'
demo = 'your api key'
IS = requests.get(f'https://financialmodelingprep.com/api/v3/income-statement/{company}?apikey={demo}').json()
count = 0
#get revenue growth to estimate future sales
revenue_g = []
for item in IS:
  if count < 4:
    #print(item)
    revenue_g.append(item['revenue'])
    count = count + 1

revenue_g = (revenue_g[0] - revenue_g[1]) /revenue_g[1] 
#revenue_g = 0.05
print(revenue_g)
#Get net income
net_income = IS[0]['netIncome']

BS = requests.get(f'https://financialmodelingprep.com/api/v3/balance-sheet-statement/{company}?apikey={demo}').json()

#get income statement as % of revenue for future predictions and forecast 5 next IS years
income_statement = pd.DataFrame.from_dict(IS[0],orient='index')
income_statement = income_statement[5:26]
income_statement.columns = ['current_year']
income_statement['as_%_of_revenue'] = income_statement / income_statement.iloc[0]

#forecasting 5 next years income statement
income_statement['next_year'] =  (income_statement['current_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_2_year'] =  (income_statement['next_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_3_year'] =  (income_statement['next_2_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_4_year'] =  (income_statement['next_3_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 
income_statement['next_5_year'] =  (income_statement['next_4_year']['revenue'] * (1+revenue_g)) * income_statement['as_%_of_revenue'] 

#Get Balance sheet as a percentage of revenue
balance_sheet = pd.DataFrame.from_dict(BS[0],orient='index')
balance_sheet = balance_sheet[5:-2]
balance_sheet.columns = ['current_year']
balance_sheet['as_%_of_revenue'] = balance_sheet / income_statement['current_year'].iloc[0]

#forecasting the next 5 years Balance Sheet.
balance_sheet['next_year'] =  income_statement['next_year'] ['revenue'] * balance_sheet['as_%_of_revenue']
balance_sheet['next_2_year'] =  income_statement['next_2_year'] ['revenue'] * balance_sheet['as_%_of_revenue']
balance_sheet['next_3_year'] =  income_statement['next_3_year']['revenue'] * balance_sheet['as_%_of_revenue'] 
balance_sheet['next_4_year'] =  income_statement['next_4_year']['revenue']  * balance_sheet['as_%_of_revenue'] 
balance_sheet['next_5_year'] =  income_statement['next_5_year']['revenue'] * balance_sheet['as_%_of_revenue']

CF_forecast = {}
CF_forecast['next_year'] = {}
CF_forecast['next_year']['netIncome'] = income_statement['next_year']['netIncome']
CF_forecast['next_year']['inc_depreciation'] = income_statement['next_year']['depreciationAndAmortization'] - income_statement['current_year']['depreciationAndAmortization']
CF_forecast['next_year']['inc_receivables'] = balance_sheet['next_year']['netReceivables'] - balance_sheet['current_year']['netReceivables']
CF_forecast['next_year']['inc_inventory'] = balance_sheet['next_year']['inventory'] - balance_sheet['current_year']['inventory']
CF_forecast['next_year']['inc_payables'] = balance_sheet['next_year']['accountPayables'] - balance_sheet['current_year']['accountPayables']
CF_forecast['next_year']['CF_operations'] = CF_forecast['next_year']['netIncome'] + CF_forecast['next_year']['inc_depreciation'] + (CF_forecast['next_year']['inc_receivables'] * -1) + (CF_forecast['next_year']['inc_inventory'] *-1) + CF_forecast['next_year']['inc_payables']
CF_forecast['next_year']['CAPEX'] = balance_sheet['next_year']['propertyPlantEquipmentNet'] - balance_sheet['current_year']['propertyPlantEquipmentNet'] + income_statement['next_year']['depreciationAndAmortization']

CF_forecast['next_year']['FCF'] = CF_forecast['next_year']['CAPEX'] + CF_forecast['next_year']['CF_operations']


CF_forecast['next_2_year'] = {}
CF_forecast['next_2_year']['netIncome'] = income_statement['next_2_year']['netIncome']

CF_forecast['next_2_year']['inc_depreciation'] = income_statement['next_2_year']['depreciationAndAmortization'] - income_statement['next_year']['depreciationAndAmortization']
CF_forecast['next_2_year']['inc_receivables'] = balance_sheet['next_2_year']['netReceivables'] - balance_sheet['next_year']['netReceivables']
CF_forecast['next_2_year']['inc_inventory'] = balance_sheet['next_2_year']['inventory'] - balance_sheet['next_year']['inventory']
CF_forecast['next_2_year']['inc_payables'] = balance_sheet['next_2_year']['accountPayables'] - balance_sheet['next_year']['accountPayables']
CF_forecast['next_2_year']['CF_operations'] = CF_forecast['next_2_year']['netIncome'] + CF_forecast['next_2_year']['inc_depreciation'] + (CF_forecast['next_2_year']['inc_receivables'] * -1) + (CF_forecast['next_2_year']['inc_inventory'] *-1) + CF_forecast['next_2_year']['inc_payables']
CF_forecast['next_2_year']['CAPEX'] = balance_sheet['next_2_year']['propertyPlantEquipmentNet'] - balance_sheet['next_year']['propertyPlantEquipmentNet'] + income_statement['next_2_year']['depreciationAndAmortization']
CF_forecast['next_2_year']['FCF'] = CF_forecast['next_2_year']['CAPEX'] + CF_forecast['next_2_year']['CF_operations']


CF_forecast['next_3_year'] = {}
CF_forecast['next_3_year']['netIncome'] = income_statement['next_3_year']['netIncome']

CF_forecast['next_3_year']['inc_depreciation'] = income_statement['next_3_year']['depreciationAndAmortization'] - income_statement['next_2_year']['depreciationAndAmortization']
CF_forecast['next_3_year']['inc_receivables'] = balance_sheet['next_3_year']['netReceivables'] - balance_sheet['next_2_year']['netReceivables']
CF_forecast['next_3_year']['inc_inventory'] = balance_sheet['next_3_year']['inventory'] - balance_sheet['next_2_year']['inventory']
CF_forecast['next_3_year']['inc_payables'] = balance_sheet['next_3_year']['accountPayables'] - balance_sheet['next_2_year']['accountPayables']
CF_forecast['next_3_year']['CF_operations'] = CF_forecast['next_3_year']['netIncome'] + CF_forecast['next_3_year']['inc_depreciation'] + (CF_forecast['next_3_year']['inc_receivables'] * -1) + (CF_forecast['next_3_year']['inc_inventory'] *-1) + CF_forecast['next_3_year']['inc_payables']
CF_forecast['next_3_year']['CAPEX'] = balance_sheet['next_3_year']['propertyPlantEquipmentNet'] - balance_sheet['next_2_year']['propertyPlantEquipmentNet'] + income_statement['next_3_year']['depreciationAndAmortization']
CF_forecast['next_3_year']['FCF'] = CF_forecast['next_3_year']['CAPEX'] + CF_forecast['next_3_year']['CF_operations']


CF_forecast['next_4_year'] = {}
CF_forecast['next_4_year']['netIncome'] = income_statement['next_4_year']['netIncome']

CF_forecast['next_4_year']['inc_depreciation'] = income_statement['next_4_year']['depreciationAndAmortization'] - income_statement['next_3_year']['depreciationAndAmortization']
CF_forecast['next_4_year']['inc_receivables'] = balance_sheet['next_4_year']['netReceivables'] - balance_sheet['next_3_year']['netReceivables']
CF_forecast['next_4_year']['inc_inventory'] = balance_sheet['next_4_year']['inventory'] - balance_sheet['next_3_year']['inventory']
CF_forecast['next_4_year']['inc_payables'] = balance_sheet['next_4_year']['accountPayables'] - balance_sheet['next_3_year']['accountPayables']
CF_forecast['next_4_year']['CF_operations'] = CF_forecast['next_4_year']['netIncome'] + CF_forecast['next_4_year']['inc_depreciation'] + (CF_forecast['next_4_year']['inc_receivables'] * -1) + (CF_forecast['next_4_year']['inc_inventory'] *-1) + CF_forecast['next_4_year']['inc_payables']
CF_forecast['next_4_year']['CAPEX'] = balance_sheet['next_4_year']['propertyPlantEquipmentNet'] - balance_sheet['next_3_year']['propertyPlantEquipmentNet'] + income_statement['next_4_year']['depreciationAndAmortization']
CF_forecast['next_4_year']['FCF'] = CF_forecast['next_4_year']['CAPEX'] + CF_forecast['next_4_year']['CF_operations']

CF_forecast['next_5_year'] = {}
CF_forecast['next_5_year']['netIncome'] = income_statement['next_5_year']['netIncome']

CF_forecast['next_5_year']['inc_depreciation'] = income_statement['next_5_year']['depreciationAndAmortization'] - income_statement['next_4_year']['depreciationAndAmortization']
CF_forecast['next_5_year']['inc_receivables'] = balance_sheet['next_5_year']['netReceivables'] - balance_sheet['next_4_year']['netReceivables']
CF_forecast['next_5_year']['inc_inventory'] = balance_sheet['next_5_year']['inventory'] - balance_sheet['next_4_year']['inventory']
CF_forecast['next_5_year']['inc_payables'] = balance_sheet['next_5_year']['accountPayables'] - balance_sheet['next_4_year']['accountPayables']
CF_forecast['next_5_year']['CF_operations'] = CF_forecast['next_5_year']['netIncome'] + CF_forecast['next_5_year']['inc_depreciation'] + (CF_forecast['next_5_year']['inc_receivables'] * -1) + (CF_forecast['next_5_year']['inc_inventory'] *-1) + CF_forecast['next_5_year']['inc_payables']
CF_forecast['next_5_year']['CAPEX'] = balance_sheet['next_5_year']['propertyPlantEquipmentNet'] - balance_sheet['next_4_year']['propertyPlantEquipmentNet'] + income_statement['next_5_year']['depreciationAndAmortization']
CF_forecast['next_5_year']['FCF'] = CF_forecast['next_5_year']['CAPEX'] + CF_forecast['next_5_year']['CF_operations']

#add the forecasted cash flows into a Pandas
CF_forec = pd.DataFrame.from_dict(CF_forecast,orient='columns')

#add below option to format the dataframe with thousand separators
pd.options.display.float_format = '{:,.0f}'.format

print(CF_forec)

import pandas_datareader.data as web
import datetime
import requests


#demo = 'your api key'
#Interest coverage ratio = EBIT / interest expenses

def interest_coveraga_and_RF(company):
  IS= requests.get(f'https://financialmodelingprep.com/api/v3/income-statement/{company}?apikey={demo}').json()
  EBIT= IS[0]['ebitda'] - IS[0]['depreciationAndAmortization'] 
  interest_expense = IS[0]['interestExpense']
  interest_coverage_ratio = EBIT / interest_expense

    #RF
  start = datetime.datetime(2019, 7, 10)
        
  end= datetime.datetime.today().strftime('%Y-%m-%d')
  #end = datetime.datetime(2020, 7, 10)

  Treasury = web.DataReader(['TB1YR'], 'fred', start, end)
  RF = float(Treasury.iloc[-1])
  RF = RF/100
  return [RF,interest_coverage_ratio]
  
#Cost of debt
def cost_of_debt(company, RF,interest_coverage_ratio):
  if interest_coverage_ratio > 8.5:
    #Rating is AAA
    credit_spread = 0.0063
  if (interest_coverage_ratio > 6.5) & (interest_coverage_ratio <= 8.5):
    #Rating is AA
    credit_spread = 0.0078
  if (interest_coverage_ratio > 5.5) & (interest_coverage_ratio <=  6.5):
    #Rating is A+
    credit_spread = 0.0098
  if (interest_coverage_ratio > 4.25) & (interest_coverage_ratio <=  5.49):
    #Rating is A
    credit_spread = 0.0108
  if (interest_coverage_ratio > 3) & (interest_coverage_ratio <=  4.25):
    #Rating is A-
    credit_spread = 0.0122
  if (interest_coverage_ratio > 2.5) & (interest_coverage_ratio <=  3):
    #Rating is BBB
    credit_spread = 0.0156
  if (interest_coverage_ratio > 2.25) & (interest_coverage_ratio <=  2.5):
    #Rating is BB+
    credit_spread = 0.02
  if (interest_coverage_ratio > 2) & (interest_coverage_ratio <=  2.25):
    #Rating is BB
    credit_spread = 0.0240
  if (interest_coverage_ratio > 1.75) & (interest_coverage_ratio <=  2):
    #Rating is B+
    credit_spread = 0.0351
  if (interest_coverage_ratio > 1.5) & (interest_coverage_ratio <=  1.75):
    #Rating is B
    credit_spread = 0.0421
  if (interest_coverage_ratio > 1.25) & (interest_coverage_ratio <=  1.5):
    #Rating is B-
    credit_spread = 0.0515
  if (interest_coverage_ratio > 0.8) & (interest_coverage_ratio <=  1.25):
    #Rating is CCC
    credit_spread = 0.0820
  if (interest_coverage_ratio > 0.65) & (interest_coverage_ratio <=  0.8):
    #Rating is CC
    credit_spread = 0.0864
  if (interest_coverage_ratio > 0.2) & (interest_coverage_ratio <=  0.65):
    #Rating is C
    credit_spread = 0.1134
  if interest_coverage_ratio <=  0.2:
    #Rating is D
    credit_spread = 0.1512
  
  cost_of_debt = RF + credit_spread
  return cost_of_debt


def costofequity(company):


  #RF
  start = datetime.datetime(2019, 7, 10)
  end= datetime.datetime.today().strftime('%Y-%m-%d')
  #end = datetime.datetime(2020, 7, 10)

  Treasury = web.DataReader(['TB1YR'], 'fred', start, end)
  RF = float(Treasury.iloc[-1])
  RF = RF/100

#Beta

  beta = requests.get(f'https://financialmodelingprep.com/api/v3/company/profile/{company}?apikey={demo}')
  beta = beta.json()
  beta = float(beta['profile']['beta'])


  #Market Return
  start = datetime.datetime(2019, 7, 10)
  end= datetime.datetime.today().strftime('%Y-%m-%d')

  SP500 = web.DataReader(['sp500'], 'fred', start, end)
      #Drop all Not a number values using drop method.
  SP500.dropna(inplace = True)

  SP500yearlyreturn = (SP500['sp500'].iloc[-1]/ SP500['sp500'].iloc[-252])-1
    
  cost_of_equity = RF+(beta*(SP500yearlyreturn - RF))
  return cost_of_equity

#effective tax rate and capital structure
def wacc(company):
  FR = requests.get(f'https://financialmodelingprep.com/api/v3/ratios/{company}?apikey={demo}').json()

  ETR = FR[0]['effectiveTaxRate']

# 
  BS = requests.get(f'https://financialmodelingprep.com/api/v3/balance-sheet-statement/{company}?period=quarter&apikey={demo}').json()



  Debt_to = BS[0]['totalDebt'] / (BS[0]['totalDebt'] + BS[0]['totalStockholdersEquity'])
  equity_to = BS[0]['totalStockholdersEquity'] / (BS[0]['totalDebt'] + BS[0]['totalStockholdersEquity'])

  WACC = (kd*(1-ETR)*Debt_to) + (ke*equity_to)
  return WACC

RF_and_IntCov = interest_coveraga_and_RF(company)
RF = RF_and_IntCov[0]
interest_coverage_ratio = RF_and_IntCov[1]
ke = costofequity(company)
kd = cost_of_debt(company,RF,interest_coverage_ratio)
wacc_company = wacc(company)
print('wacc of ' + company + ' is ' + str((wacc_company*100))+'%')


#FCF List of CFs for each year
FCF_List = CF_forec.iloc[-1].values.tolist()
npv = np.npv(wacc_company,FCF_List)

#Terminal value
LTGrowth = 0.02

Terminal_value = (CF_forecast['next_5_year']['FCF'] * (1+ LTGrowth)) /(wacc_company  - LTGrowth)

Terminal_value_Discounted = Terminal_value/(1+wacc_company)**4
Terminal_value_Discounted

target_equity_value = Terminal_value_Discounted + npv
debt = balance_sheet['current_year']['totalDebt']
target_value = target_equity_value - debt
numbre_of_shares = requests.get(f'https://financialmodelingprep.com/api/v3/enterprise-values/{company}?apikey={demo}').json()
numbre_of_shares = numbre_of_shares[0]['numberOfShares']

target_price_per_share = target_value/numbre_of_shares
target_price_per_share
print(company + ' forecasted price per stock is ' + str(target_price_per_share) )
print('the forecast is based on the following assumptions: '+ 'revenue growth: ' + str(revenue_g) + ' Cost of Capital: ' + str(wacc_company) )
print('perpetuity growth: ' + str(LTGrowth)  )


8 thoughts on “Discounted Cash Flow with Python – Valuing a Company

  1. Hey,

    unbelievable work. I dont know what to say, thanks!

    I just had a problem in the middle part with
    income_statement[‘as_%_of_revenue’] = income_statement / income_statement.iloc[0]
    as same as
    balance_sheet[‘as_%_of_revenue’] = balance_sheet /income_statement[‘current_year’].iloc[0]

    it submitted me a TypeError because it was a division str / str (DataFrame = Object)

    this is way i had to declare income_statement.iloc[0] = revenue = IS[0][“revenue”] .Hence the same what you did before with net_income = IS[0][‘netIncome’]

    Now it works but im not sure if its properly. F.e a company like Alteryx with a net los results like this

    wacc of AYX is 18.847741863866315%
    AYX forecasted price per stock is 0.12656134710068778
    the forecast is based on the following assumptions: revenue growth: 0.18520255557416668 Cost of Capital: 0.18847741863866316
    perpetuity growth: 0.02

    Do you have any experience with those cases?

    The prices i get seem like in general “out of nowhere”.

    I think maybe i miss interpreted your conduction and thereby my change within the code

    do you calculate balance_sheet[‘as_%_of_revenue’] = net_income / revenue in

    B. Retrieving Income Statement and Balance Sheet

    Next, we get the income statement and balance sheet.

    First, we calculate the full income statement as a percentage of the revenue (income_statement[‘as_%_of_revenue’] = net_income/revenue). Then, we forecast the next 5 year income statement by multiplying the revenue of the previous year times the revenue_g calculated in section A. Having done that, we can multiply each of the income statement items by the % of revenue to get a full income statement.

    Thanks a lot
    I will subscripe you now on Yotube, any other channels?

    Greetings

    Sven

    1. Thanks for subscribing. If the company has a net loss, you need to estimate future revenue and see if it will make a gain after certain time. Otheriwse, the DCF valuation approach may not give a good outcome.

      On the code question. I have a video in my channel going through the code step by step. Could you please try to watch and let me know if you are still having problems?

      Thanks
      Jose

      1. Hey Jose,

        thanks for the advice. I did and i think i fould the difference(s). First at all i work with IDE Pycharm but i do not think thats why the difference comes up.

        First at all, because we are some month further i tried 2/third (excluded the later on WACC Costs because od datetime end) of your code from the point of view when you created the code, means especially i had to take IS[1] instead of IS[0], so thats how i could check both numbers, your tables and mine (there is a new Income Statement as Balance Sheet)

        Problem of my first response:

        Within your code you use
        balance_sheet = balance_sheet[5:-2]
        balance_sheet.columns = [‘current_year’]
        balance_sheet[‘as_%_of_revenue’] = balance_sheet / income_statement[‘current_year’].iloc[0]

        and it seems to work for you. But for me and any other interested guys/girls out there it could help if you set for income statement as for balance sheet[6:], bceuase the first row with iloc at least for me, was FY and hencewith a Str which ended up in a Typerror ( Int/Str no possible)
        Then use normally
        income_statement[‘as_%_of_revenue’] =income_statement/income_statement.iloc[0]

        or of course [5:] but then at the end [1]

        income_statement[‘as_%_of_revenue’] =income_statement/income_statement.iloc[1]

        Thats what solved the problem. Keep care not to switch elsewise the rows are offset.

        Furthermore i wanted to backtest up to caluclating the Future Cahsflows, if my resluts end up in the same as yours. Indeed it did, at least in kind of 75%. It seems that the data source from the Income Statement and Balance Sheet are different for EBITDA, EBIT Ratio & TotalOtherIncomeExpenses. All other numbers were the same for me.
        I came up with it because by calculating the CAPEX and FCF it arises differences even by having the same data source. The whole code till this point was the same.

        So in the end by writing it to excel there was 9% (more)difference income receivables, 56%(more) in CAPEX and 5%(more) in FCF

        Do you have an idea how this can arise? Or why the data sourse seems to be changed?

        Thanks and Greets

        Sven

        1. Hi Sven, I think it may be that the API changed the source data. I also spotted a couple of issues where the API was giving me the wrong output. In this case, the best is to compare it with the Income Statement from Yahoo Finance or from the SEC fillings. If the API output does not match the company fillings, then write in Twitter a DM to financialmodelingprep for correction.

      2. income_statement = income_statement[6:27]
        instead starting with 5 solved the problem, or entering below [1] if you start with 5

        income_statement[‘as_%_of_revenue’] =income_statement/income_statement.iloc[0]

        And important the data source which Jose uses is for EBITDA, EBIT Ratio, Total Other IncomeExpenses different (idkw) hence especially CAPEX will be 50%higher and FCF kind of 3%

  2. can you figure out what’s being changed with the FMP Data structure?

    I get the below type errors for balance_sheet[‘as_%_of_revenue’] = balance_sheet / income_statement[‘current_year’].iloc[0]. for previous income_statement[‘as_%_of_revenue’] = income_statement / income_statement.iloc[0]

    I figure out it’s income table added one more row leads to the error, but for the balance sheet I am not able to figure out

    ———————————————————————-
    TypeError Traceback (most recent call last)
    /usr/local/lib/python3.7/dist-packages/pandas/core/ops/array_ops.py in na_arithmetic_op(left, right, op, is_cmp)
    142 try:
    –> 143 result = expressions.evaluate(op, left, right)
    144 except TypeError:

    10 frames
    TypeError: unsupported operand type(s) for /: ‘str’ and ‘int’

    During handling of the above exception, another exception occurred:

    TypeError Traceback (most recent call last)
    /usr/local/lib/python3.7/dist-packages/pandas/core/ops/array_ops.py in masked_arith_op(x, y, op)
    110 if mask.any():
    111 with np.errstate(all=”ignore”):
    –> 112 result[mask] = op(xrav[mask], y)
    113
    114 result, _ = maybe_upcast_putmask(result, ~mask, np.nan)

    TypeError: unsupported operand type(s) for /: ‘str’ and ‘int’

    1. I am not sure. Check in the official documentation. I will check as well as soon as I have some time

  3. Hi,

    Since we can get FCF from financialmodelingprep directly, can I just use the last year number and apply the growth % for the next 5 years? Thanks.

    Regards,
    Lawrence

Comments are closed.