private void CaculateLowLimitResult(AlertInfo stdLowAlertInfo) { var maxStickerQuote = HistoricalQuotes.Max(s => s.High); var minStickerQuote = HistoricalQuotes.Min(s => s.Low); var currentPrice = HistoricalQuotes.OrderByDescending(q => q.Date).FirstOrDefault(); CalculateHighAndLowLimitPriceForLowAlertInfo(stdLowAlertInfo, maxStickerQuote, minStickerQuote); if (currentPrice?.Close <= stdLowAlertInfo.HighLimit) { ToAlertToBuy = true; } }
private void CalculateSuggestionPrices(AlertInfo stdHighAlertInfo, AlertInfo stdLowAlertInfo) { var maxStickerQuote = HistoricalQuotes.Max(s => s.High); var minStickerQuote = HistoricalQuotes.Min(s => s.Low); CalculateHighAndLowLimitPriceForLowAlertInfo(stdLowAlertInfo, maxStickerQuote, minStickerQuote); CalculateHighAndLowLimitPriceForHighRangeAlertInfo(stdHighAlertInfo, maxStickerQuote, maxStickerQuote); if (stdHighAlertInfo.HighLimit > stdLowAlertInfo.HighLimit) { MakeSuggestions(stdHighAlertInfo, stdLowAlertInfo); } else { MakeSuggestions(stdLowAlertInfo, stdHighAlertInfo); } }