/// <summary>
        /// As the name indicates, the Morning Star is a sign of hope and a new beginning in a gloomy downtrend.
        /// The pattern consists of three candles: one short-bodied candle (called a doji or a spinning top) between a preceding long black candle and a succeeding long white one.
        /// The color of the real body of the short candle can be either white or black, and there is no overlap between its body and that of the black candle before.
        /// It shows that the selling pressure that was there the day before is now subsiding.
        /// The third white candle overlaps with the body of the black candle and shows a renewed buyer pressure and a start of a bullish reversal, especially if confirmed by the higher volume.
        /// </summary>
        /// <param name="before"></param>
        /// <returns></returns>
        public static bool IsMorningStar(this LinkedListNode <StockPrice> node)
        {
            if (node.Previous != null && node.Next != null)
            {
                var candleType = node.GetCandleStickType();

                //preceding long black candle
                if (node.Previous != null && node.Previous.GetCandleStickType() == CandleStickTypes.RedFilled)
                {
                    //one short-bodied candle (called a doji or a spinning top)
                    if (node.Value.HasShortBody)
                    {
                        //The color of the real body of the short candle can be either white or black
                        //there is no overlap between its body and that of the black candle before.
                        if (((candleType == CandleStickTypes.GreenHollow || candleType == CandleStickTypes.GreenHollow) && node.Previous.Value.Close > node.Value.Close) ||
                            ((candleType == CandleStickTypes.RedHollow || candleType == CandleStickTypes.RedFilled) && node.Previous.Value.Close > node.Value.Open))
                        {
                            //succeeding long white one
                            if (node.Next.GetCandleStickType() == CandleStickTypes.GreenHollow)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
            return(false);
        }
        /// <summary>
        /// The Inverted Hammer also forms in a downtrend and represents a likely trend reversal or support.
        /// It’s identical to the Hammer except for the longer upper shadow, which indicates buying pressure after the opening price, followed by considerable selling pressure, which however wasn’t enough to bring the price down below its opening value.
        /// Again, bullish confirmation is required, and it can come in the form of a long hollow candlestick or a gap up, accompanied by a heavy trading volume.
        /// </summary>
        /// <returns></returns>
        public static bool IsInvertedHammer(this LinkedListNode <StockPrice> node)
        {
            if (node == null || node.Previous == null)
            {
                return(false);
            }
            var candleType = node.GetCandleStickType();

            if (candleType == CandleStickTypes.GreenHollow)
            {
                if (Math.Abs(node.Value.ChangePercent ?? 0) < Math.Abs(node.Previous.Value.ChangePercent ?? 0))
                {
                    //The body of the candle is short  with a longer upper shadow
                    return(node.Value.HasShortBody && node.Value.UpperShadow > node.Value.LowerShadow);
                }
            }

            return(false);
        }
        /// <summary>
        /// Similar to the engulfing pattern, the Piercing Line is a two-candle bullish reversal pattern, also occurring in downtrends.
        /// The first long black candle is followed by a white candle that opens lower than the previous close.
        /// Soon thereafter, the buying pressure pushes the price up halfway or more (preferably two-thirds of the way) into the real body of the black candle.
        /// </summary>
        /// <param name="before"></param>
        /// <returns></returns>
        public static bool IsPiercingLine(this LinkedListNode <StockPrice> node)
        {
            if (node == null || node.Previous == null)
            {
                return(false);
            }
            var candleType = node.GetCandleStickType();

            if (candleType == CandleStickTypes.GreenHollow)
            {
                if (Math.Abs(node.Value.ChangePercent ?? 0) < Math.Abs(node.Previous.Value.ChangePercent ?? 0))
                {
                    if (!node.Value.HasShortBody)
                    {
                        return(node.Value.Open < node.Previous.Value.Close);
                    }
                }
            }

            return(false);
        }