public void EvaluateMotherFuckerr(string stockQuote, bool isFinancial = false) { levermannParameters = GetLevermannParameters(stockQuote); levermannFinalPoints = GetLevermannFinalPoints(levermannParameters, isFinancial); shortQuoteNameAndPrice = GetShortQuoteNameAndPrice(stockQuote); }
public LevermannFinalPoint GetLevermannFinalPoints(LevermannParameter levermannParameters, bool isFinancial = false) { double tolerance; var result = new LevermannFinalPoint(); // 1 // +1, if the return on equity is greater than 20 %. // 0, if the return on equity is between 10 and 20 %. // - 1, if the return on equity is less than 10 %. tolerance = 0.3; if (levermannParameters.RoE >= 20 - tolerance) { result.RoE = 1; } if (levermannParameters.RoE < 10 - tolerance) { result.RoE = -1; } // 2 // +1, if the EBIT-Margin is greater than 12%. // 0, if the EBIT-Margin is between 6 and 12%. // -1, if the EBIT-Margin is less than 6%. tolerance = 0.2; if (levermannParameters.EBITMargin >= 12 - tolerance) { result.EBITMargin = 1; } if (levermannParameters.EBITMargin < 6 - tolerance) { result.EBITMargin = -1; } if (isFinancial) { result.EBITMargin = 0; } // 3 // +1, if the equity ratio is greater than 25%. // 0, if the equity ratio is between 15 and 25%. // -1, if the equity ratio is less than 15%. tolerance = 0.5; if (levermannParameters.EquityRatio >= 25 - tolerance) { result.EquityRatio = 1; } if (levermannParameters.EquityRatio < 15 - tolerance) { result.EquityRatio = -1; } if (isFinancial) { if (levermannParameters.EquityRatio >= 10 - tolerance) { result.EquityRatio = 1; } if (levermannParameters.EquityRatio < 5 - tolerance) { result.EquityRatio = -1; } } // 4 // +1, if the P/E ratio is less than 12, but greater than 0. // 0 if the P/E ratio is between 12 and 16. // -1, if the P/E ratio is greater than 16 or less than 0. tolerance = 0.2; if (levermannParameters.PE1year > 0 && levermannParameters.PE1year <= 12 + tolerance) { result.PE1year = 1; } if (levermannParameters.PE1year > 16 + tolerance) { result.PE1year = -1; } // 5 if (levermannParameters.PE5years > 0 && levermannParameters.PE5years <= 12 + tolerance) { result.PE5years = 1; } if (levermannParameters.PE5years > 16 + tolerance) { result.PE5years = -1; } // 6 // +1, if the factor is greater than or equal to 2,5. // 0, if the factor is between 1,5 and 2,5. // -1, if the factor is less than or equal to 1,5. tolerance = 0.1; if (levermannParameters.AnalystOpinions >= 2.5 - tolerance) { result.AnalystOpinions = 1; } if (levermannParameters.AnalystOpinions < 1.5 - tolerance) { result.AnalystOpinions = -1; } // 7 // +1, if the adjusted performance is greater than 1%. // -1 if the adjusted performance is less than -1%. tolerance = 0; if (levermannParameters.ReactionToQuarterlyRelease >= 1 - tolerance) { result.ReactionToQuarterlyRelease = 1; } if (levermannParameters.ReactionToQuarterlyRelease < -1 - tolerance) { result.ReactionToQuarterlyRelease = -1; } // 8 // +1, if the profit revision is greater than 5%. // 0, if the profit revision is between -5% and + 5%. // -1 if the profit revision is less than -5%. tolerance = 0.1; if (levermannParameters.ProfitRevision >= 5 - tolerance) { result.ProfitRevision = 1; } if (levermannParameters.ProfitRevision < -5 - tolerance) { result.ProfitRevision = -1; } // 9 // +1, if the price has risen more than + 5% over the period. // 0, if the price has changed between -5% and + 5% during the period. // -1, if the price has fallen more than -5% over the period. tolerance = 0.1; if (levermannParameters.PriceChange6months >= 5 - tolerance) { result.PriceChange6months = 1; } if (levermannParameters.PriceChange6months < -5 - tolerance) { result.PriceChange6months = -1; } // 10 if (levermannParameters.PriceChange12months >= 5 - tolerance) { result.PriceChange12months = 1; } if (levermannParameters.PriceChange12months < -5 - tolerance) { result.PriceChange12months = -1; } // 11 result.PriceMomentum = levermannParameters.PriceMomentum; // 12 result.ReversalEffect = levermannParameters.ReversalEffect; // 13 // +1, if earnings growth is greater than 5%. // 0, if earnings growth is between -5% and +5%. // -1, if earnings growth is less than -5%. tolerance = 0.1; if (levermannParameters.ProfitGrowth >= 5 - tolerance) { result.ProfitGrowth = 1; } if (levermannParameters.ProfitGrowth < -5 - tolerance) { result.ProfitGrowth = -1; } return(result); }
public TheMotherEvaluator() { _driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); levermannParameters = new LevermannParameter(); levermannFinalPoints = new LevermannFinalPoint(); }