﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/bbeditor.css'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Candle.IsBullishOrBearish() never returns false (i.e. is never Bearish!)</title>
  <id>~/topic/8064/candle_isbullishorbearish()-never-returns-false-(i_e_-is-never-bearish!)/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-10T11:36:45Z</updated>
  <logo>https://stocksharp.ru/images/logo.png</logo>
  <link href="https://stocksharp.ru/handlers/atom.ashx?category=topic&amp;id=8064" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.ru/posts/m/39126/</id>
    <title type="text">I think you right. There is no code line for false return. It is definitely wrong. </title>
    <published>2017-02-06T15:35:25Z</published>
    <updated>2017-02-06T15:35:25Z</updated>
    <author>
      <name>Mikhail Sukhov</name>
      <uri>https://stocksharp.ru/users/201/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;I think you right. There is no code line for false return. It is definitely wrong.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.ru/posts/m/39121/</id>
    <title type="text">I noticed that the above method never returns &amp;apos;false&amp;apos; and so cannot indicate bearish signals. The so...</title>
    <published>2017-02-05T22:35:35Z</published>
    <updated>2017-02-05T22:55:40Z</updated>
    <author>
      <name>Sean Kenwrick</name>
      <uri>https://stocksharp.ru/users/98038/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;I noticed that the above method never returns 'false' and so cannot indicate bearish signals.    The source code is as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;           ```
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;/// &lt;summary&gt;
/// Whether the candle is bullish or bearish.
/// &lt;/summary&gt;
/// &lt;param name="candle"&gt;The candle which should be checked for the trend.&lt;/param&gt;
/// &lt;returns&gt;&lt;see langword="true" /&gt; if bullish, &lt;see langword="false" /&gt;, if bearish, &lt;see langword="null" /&gt; - neither one nor the other.&lt;/returns&gt;
public static bool? IsBullishOrBearish(this Candle candle)
{
if (candle == null)
throw new ArgumentNullException(nameof(candle));&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;		var isWhiteOrBlack = candle.IsWhiteOrBlack();

		switch (isWhiteOrBlack)
		{
			case true:
				if (candle.GetBottomShadow() &amp;gt;= candle.GetBody())
					return true;
				break;
			case false:
				if (candle.GetTopShadow() &amp;gt;= candle.GetBody())
					return true;
				break;
		}

		return null;
	}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;
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?



&lt;/code&gt;&lt;/pre&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>