Candle.IsBullishOrBearish() never returns false (i.e. is never Bearish!)

Candle.IsBullishOrBearish() never returns false (i.e. is never Bearish!)

I noticed that the above method never returns 'false' and so cannot indicate bearish signals. The source code is as follows:

/// <summary>
        /// Whether the candle is bullish or bearish.
        /// </summary>
        /// <param name="candle">The candle which should be checked for the trend.</param>
        /// <returns><see langword="true" /> if bullish, <see langword="false" />, if bearish, <see langword="null" /> - neither one nor the other.</returns>
        public static bool? IsBullishOrBearish(this Candle candle)
            if (candle == null)
                throw new ArgumentNullException(nameof(candle));

            var isWhiteOrBlack = candle.IsWhiteOrBlack();

            switch (isWhiteOrBlack)
                case true:
                    if (candle.GetBottomShadow() >= candle.GetBody())
                        return true;
                case false:
                    if (candle.GetTopShadow() >= candle.GetBody())
                        return true;

            return null;

I'm guessing that the second case should return 'false' . It looks to me like the top case is looking for an inverted hammer (bullish), whereas the bottom case is looking for a shooting star (bearish). However shouldn't it also be looking at the other shadows in each case since we want a short shadow opposite the long shadows for both inverted hammer and shooting start right?? Am I missing something?


Mikhail Sukhov

Date: 2/6/2017

I think you right. There is no code line for false return. It is definitely wrong.

Attach files by dragging & dropping, , or pasting from the clipboard.