/// <summary>
        /// Returns True if the index bar is a doji bar
        /// </summary>
        /// <param name="bars"></param>
        /// <param name="index">The bar index number in a market series</param>
        /// <returns>bool</returns>
        public static bool IsDojiBar(this Bars bars, int index)
        {
            double barBodyRange = bars.GetBarRange(index, true);
            double barRange     = bars.GetBarRange(index);

            double meanBarRange = bars.GetAverageBarRange(index - 1, 50);

            return(barRange < meanBarRange / 3 && barBodyRange / barRange < 0.5);
        }
        /// <summary>
        /// Returns True if the index bar is a rejection bar
        /// </summary>
        /// <param name="bars"></param>
        /// <param name="index">The bar index number in a market series</param>
        /// <returns>bool</returns>
        public static bool IsRejectionBar(this Bars bars, int index)
        {
            double barBodyRange = bars.GetBarRange(index, true);
            double barRange     = bars.GetBarRange(index);

            BarType barType = bars.GetBarType(index);

            double meanBarRange = bars.GetAverageBarRange(index - 1, 50);

            if (barBodyRange / barRange < 0.3 && barRange > meanBarRange)
            {
                var barMiddle        = barRange * 0.5 + bars.LowPrices[index];
                var barFirstQuartile = barRange * 0.25 + bars.LowPrices[index];
                var barThirdQuartile = barRange * 0.75 + bars.LowPrices[index];

                if (bars.OpenPrices[index] > barMiddle && bars.ClosePrices[index] > barThirdQuartile && barType == BarType.Bullish ||
                    bars.OpenPrices[index] < barMiddle && bars.ClosePrices[index] < barFirstQuartile && barType == BarType.Bearish)
                {
                    return(true);
                }
            }

            return(false);
        }