public AlertMgr(string currentSticker)
 {
     CurrentSticker = currentSticker;
     GetQuoteAndStdIndicator();
     Factory           = new AlertFactory(StdDevResults, HistoricalQuotes);
     CurrentQuote      = HistoricalQuotes.OrderByDescending(q => q.Date).FirstOrDefault();
     RsiResults        = new List <StochResult>();
     ChaikinOscResults = new List <ChaikinOscResult>();
 }
        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 SuggestedAction CheckForAlert()
        {
            var currentPrice = HistoricalQuotes.OrderByDescending(q => q.Date).FirstOrDefault();

            if (currentPrice?.Close >= Factory.Calculator.SellingSuggestion.LowLimit)
            {
                return(SuggestedAction.Sell);
            }
            else if (currentPrice?.Close < Factory.Calculator.SellingSuggestion.LowLimit && SendHighLimit())
            {
                return(SuggestedAction.WaitToSell);
            }
            else if (Factory.Calculator.BuyingSuggestion.HighLimit >= currentPrice?.Close)
            {
                return(SuggestedAction.Buy);
            }
            else if (Factory.Calculator.BuyingSuggestion.HighLimit < currentPrice?.Close && !SendHighLimit())
            {
                return(SuggestedAction.WaitToBuy);
            }
            return(SuggestedAction.Wait);
        }
        private SuggestedAction CheckForSecondAlert()
        {
            var currentPrice = HistoricalQuotes.OrderByDescending(q => q.Date).FirstOrDefault();

            if (currentPrice?.Close <= Factory.SecondCalculator.SellingSuggestion.LowLimit)
            {
                return(SuggestedAction.BuyTheDip);
            }
            else if (currentPrice?.Close >= Factory.SecondCalculator.SellingSuggestion.HighLimit)
            {
                return(SuggestedAction.Sell);
            }
            else if (currentPrice?.Close >= Factory.SecondCalculator.HoldOrSellSuggestion.LowLimit &&
                     currentPrice?.Close < Factory.SecondCalculator.HoldOrSellSuggestion.HighLimit)
            {
                return(SuggestedAction.HoldPriceCouldGoUp);
            }
            else if (Factory.SecondCalculator.HoldOrBuySuggestion.HighLimit >= currentPrice?.Close &&
                     currentPrice?.Close > Factory.SecondCalculator.HoldOrBuySuggestion.LowLimit)
            {
                return(SuggestedAction.HoldPriceCouldGoDown);
            }
            else if (Factory.SecondCalculator.BuyingSuggestion.HighLimit >= currentPrice?.Close &&
                     Factory.SecondCalculator.BuyingSuggestion.LowLimit < currentPrice?.Close)
            {
                if (currentPrice?.Close < Factory.SecondCalculator.FiveBasicNumber.Mean)
                {
                    return(SuggestedAction.StrongBuy);
                }
                return(SuggestedAction.Buy);
            }
            else
            {
                return(SuggestedAction.Wait);
            }
        }