ticker = args.ticker working_directory = args.working_directory growth_rate = float(args.growth_rate) min_rate_of_return = float(args.min_rate_of_return) years_ahead = int(args.years_ahead) margin_of_safety = float(args.margin_of_safety) test = bool(args.test) file_logging = FileLogging(directory=working_directory) file_logging.logger.info('Starting basic DCF analysis:\n'\ 'growth rate: ' + str(growth_rate) +'\n'+\ 'min_rate_of_return: ' + str(min_rate_of_return) +'\n'+\ 'years_ahead: ' + str(years_ahead) +'\n'+\ 'margin_of_safety: ' + str(margin_of_safety) ) if test: ticker = 'NFLX' DCF_basic(ticker,growth_rate,min_rate_of_return,margin_of_safety,years_ahead) elif ticker != None: DCF_basic(ticker,growth_rate,min_rate_of_return,margin_of_safety,years_ahead) else: tickers = getAllTickers() for ticker in tickers:
# -*- coding: utf-8 -*- """ Created on Sat Feb 22 12:48:19 2020 @author: Jesse """ import os import datetime from model_calculations import Model_Calculation_Object from File_Logging import FileLogging current_working_directory = os.getcwd() file_logging = FileLogging(directory=current_working_directory + '\\Logging\\') class Discount_Dividend_Model(Model_Calculation_Object): """ Multistage DDM with 'nr_years' of dividend at estimated growth rate and 'perpetual_growth_rate'dividend growth rate in perpetuity. """ def __init__(self, ticker, print_messages=False, is_test=False, params=None): super().__init__(ticker, print_messages) if params == None: self.nr_years_ahead = 5 self.perpetual_growth_rate = 0.03