Skip to content

Instantly share code, notes, and snippets.

View ChristopherNickels's full-sized avatar

ChristopherNickels

View GitHub Profile
@ChristopherNickels
ChristopherNickels / write-CP.py
Last active December 23, 2019 18:30
This file was used to create a txt file of every company's company profile
"""
@authors: Christopher, Lorenzo
"""
import requests
import json
from utils import companies
def get_income_statement(company):
resp = requests.get(f"https://financialmodelingprep.com/api/v3/company/profile/{company}")
@ChristopherNickels
ChristopherNickels / write-CF.py
Last active December 24, 2019 17:43
This file was used to create a txt file of every company's cash flow statement
"""
@authors: Christopher, Lorenzo
"""
import requests
import json
from utils import companies
def get_cash_flow(company):
resp = requests.get(f"https://financialmodelingprep.com/api/v3/financials/cash-flow-statement/{company}")
@ChristopherNickels
ChristopherNickels / write-IS.py
Last active December 23, 2019 18:30
This file was used to create a txt file of every company's income statement
"""
@authors: Lorenzo, Christopher
"""
import requests
import json
from utils import companies
def get_income_statement(company):
resp = requests.get(f"https://financialmodelingprep.com/api/v3/financials/income-statement/{company}")
@ChristopherNickels
ChristopherNickels / write-BS.py
Last active December 23, 2019 18:24
This file was used to create a txt file of every company's balance sheet
"""
@authors: Lorenzo, Christopher
"""
import requests
import json
from utils import companies
def get_balance_sheet(company):
@ChristopherNickels
ChristopherNickels / utils.py
Last active December 9, 2019 23:58
Sourcing for both models
"""
@authors: Lorenzo, Christopher
"""
import json
# FOR BACKTESTING IN 2015 HIDE COMPANIES: HLT, FCAU, QSR, BAH
DATA_DIR = "data"
companies = [
@ChristopherNickels
ChristopherNickels / backtesting.py
Last active May 6, 2022 05:31
DCF Model for 2015 Portfolio
"""
@authors: Lorenzo, Christopher
"""
from utils import read_income_statement, read_balance_sheet, read_cash_flow, companies
def fcff_forecast(comp):
last_year = 2014
income = read_income_statement(comp, 2009, 2014)
ebitp = read_income_statement(comp, 2009, 2014)
@ChristopherNickels
ChristopherNickels / main.py
Last active May 6, 2022 06:05
DCF Model for 2019 Portfolio
"""
@authors: Christopher, Lorenzo
"""
from utils import read_income_statement, read_balance_sheet, read_cash_flow, read_company_profile, companies
def fcff_forecast(comp):
last_year = 2019
income = read_income_statement(comp, 2014, 2019)
ebit = read_income_statement(comp, 2014, 2019)