Example #1
0
        private static void PerformDcfAnalysis(string ticker, string source, bool quarterly, double startingFcf, double shortTermAssets, double totalDebt, double sharesOutstanding, double avgGrowth, double lastPeriodGrowth)
        {
            double lowGrowth  = 0.20 * avgGrowth;
            double highGrowth = 1.3 * avgGrowth;

            // need to come up with an estimated discount rate
            // can use WACC to get this but need to know risk free rate, etc: http://www.investopedia.com/university/dcf/dcf3.asp#axzz2N91tugy9
            // or we can use hopeful return on assets: http://seekingalpha.com/article/462411-discounted-cash-flow-what-discount-rate-to-use
            double[] discountRates = new double[] { 0.08, 0.09, 0.10 };

            double[] terminalGrowthRates = new double[] { 0, 0.02 };

            // come up with some growth rates and scenario descriptions
            Dictionary <string, double> growthRates = new Dictionary <string, double> {
                { "Average Growth", avgGrowth },
                { "High Growth", 1.3 * highGrowth },
                { "Low Growth", 0.02 * avgGrowth },
                { "Zero Growth", 0 },
                { "Negative Growth", -0.02 },
                { "Last Period Growth", lastPeriodGrowth }
            };

            foreach (string key in growthRates.Keys)
            {
                foreach (double discountRate in discountRates)
                {
                    foreach (double terminalGrowth in terminalGrowthRates)
                    {
                        DiscountCashFlowAnalysis dcfa = new DiscountCashFlowAnalysis
                        {
                            FreeCashFlow       = startingFcf,
                            CashAndShortTerm   = shortTermAssets,
                            TotalDebt          = totalDebt,
                            GrowthRate         = growthRates[key],
                            TerminalGrowthRate = terminalGrowth,
                            DiscountRate       = discountRate,
                            SharesOutstanding  = sharesOutstanding
                        };

                        dcfa.Calculate();
                        dcfa.Save(ticker, source, quarterly, key);
                    }
                }
            }
        }
        private static void PerformDcfAnalysis(string ticker, string source, bool quarterly, double startingFcf, double shortTermAssets, double totalDebt, double sharesOutstanding, double avgGrowth, double lastPeriodGrowth)
        {
            double lowGrowth = 0.20 * avgGrowth;
            double highGrowth = 1.3 * avgGrowth;

            // need to come up with an estimated discount rate
            // can use WACC to get this but need to know risk free rate, etc: http://www.investopedia.com/university/dcf/dcf3.asp#axzz2N91tugy9
            // or we can use hopeful return on assets: http://seekingalpha.com/article/462411-discounted-cash-flow-what-discount-rate-to-use
            double[] discountRates = new double[] { 0.08, 0.09, 0.10 };

            double[] terminalGrowthRates = new double[] { 0, 0.02 };

            // come up with some growth rates and scenario descriptions
            Dictionary<string, double> growthRates = new Dictionary<string, double>{
                {"Average Growth", avgGrowth},
                {"High Growth", 1.3 * highGrowth},
                {"Low Growth", 0.02 * avgGrowth},
                {"Zero Growth", 0},
                {"Negative Growth", -0.02},
                {"Last Period Growth", lastPeriodGrowth}
            };

            foreach (string key in growthRates.Keys)
            {
                foreach (double discountRate in discountRates)
                {
                    foreach (double terminalGrowth in terminalGrowthRates)
                    {
                        DiscountCashFlowAnalysis dcfa = new DiscountCashFlowAnalysis
                        {
                            FreeCashFlow = startingFcf,
                            CashAndShortTerm = shortTermAssets,
                            TotalDebt = totalDebt,
                            GrowthRate = growthRates[key],
                            TerminalGrowthRate = terminalGrowth,
                            DiscountRate = discountRate,
                            SharesOutstanding = sharesOutstanding
                        };

                        dcfa.Calculate();
                        dcfa.Save(ticker, source, quarterly, key);
                    }
                }
            }
        }