<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Questions About ambiguous Codes inside indicators '' Why & What]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/4786/" />
	<updated>2014-05-09T19:13:08Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/4786/questions-about-ambiguous-codes-inside-indicators-why-what/</id>
		<entry>
			<title type="html"><![CDATA[Re: Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/25024/#p25024" />
			<content type="html"><![CDATA[<p><strong>System</strong> namespace contains many important .NET classes as Math, Enum, ...</p><p>In your question, MA uses Enum class to take the list of MAMethod items:</p><br /><div class="codebox"><pre><code>IndParam.ListParam[1].Caption = &quot;Smoothing method&quot;;
IndParam.ListParam[1].ItemList = Enum.GetNames(typeof (MAMethod));
IndParam.ListParam[1].Index = (int) MAMethod.Simple;</code></pre></div><br /><p>Here <br /></p><div class="codebox"><pre><code>IndParam.ListParam[1].ItemList = Enum.GetNames(typeof (MAMethod));</code></pre></div><p>can be replaced with the following one without System namespace:<br /></p><div class="codebox"><pre><code>IndParam.ListParam[1].ItemList = new string[] {&quot;Simple&quot;, &quot;Weighted&quot;, &quot;Exponential&quot;, &quot;Smoothed&quot;};</code></pre></div><br /><p>However, the first code has a big advantage that if you add new Moving Average type in the future, it will be automatically added to the indicator. If you use the second code, you have to add the new method manually.<br />Other advantage is that you are protected from a spelling mistake. The following code will be compiled successfully, but the indicator will crash on runtime (S<strong>a</strong>mple).<br /></p><div class="codebox"><pre><code>IndParam.ListParam[1].ItemList = new string[] {&quot;Sample&quot;, &quot;Weighted&quot;, &quot;Exponential&quot;, &quot;Smoothed&quot;};</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2014-05-09T19:13:08Z</updated>
			<id>https://forexsb.com/forum/post/25024/#p25024</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/25020/#p25020" />
			<content type="html"><![CDATA[<p>Why <br /></p><div class="codebox"><pre><code>using System;</code></pre></div><p> in indicator like moving average </p><p>and not using it in Donchian Channel For example</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2014-05-09T12:03:00Z</updated>
			<id>https://forexsb.com/forum/post/25020/#p25020</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/25018/#p25018" />
			<content type="html"><![CDATA[<p>Thanks fotoon And Pop now its clear to me</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2014-05-09T12:00:22Z</updated>
			<id>https://forexsb.com/forum/post/25018/#p25018</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/25005/#p25005" />
			<content type="html"><![CDATA[<p>I&#039;m posting description of some parameters:</p><div class="quotebox"><blockquote><p>IsDeafultGroupAll = true; /false;</p></blockquote></div><p>Default value: IsDeafultGroupAll = false; </p><p>It sets if the program uses the default group for the indicator as per the corresponding slot or sets group &quot;All&quot;.</p><p>Normally FSB sets the Logical Groups of the indicators automatically. It sets group &quot;A&quot; for the first &quot;Opening Logic Slot&quot;, group &quot;B&quot; for the second...&nbsp; The program sets group &quot;a&quot; for all &quot;Closing logic slots&quot; by default.</p><p>This logic works for most of the indicators, but some indicators require to be used in all groups. Some examples are &quot;Entry Time&quot;, &quot;Enter Once&quot;, &quot;Long or Short&quot;...</p><div class="quotebox"><blockquote><p>IsGeneratable = true; /false;</p></blockquote></div><p>Default value:&nbsp; IsGeneratable = true;<br />Sets if Generator will use this indicator.</p><p>We set IsGeneratable = false; for the indicators, we don&#039;t to be used in Generator. Examples are: Long or Short, Lot Limiter...</p><div class="quotebox"><blockquote><p>IsDiscreteValues = true; /false;</p></blockquote></div><p>Default value: IsDiscreteValues = false;</p><p>Most of the indicators has moving values, but some of them has jumping values.<br />We set IsDiscreteValues = true; for the indicators that stay constant for several bars. For example: Aroon Histogram.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2014-05-08T10:52:27Z</updated>
			<id>https://forexsb.com/forum/post/25005/#p25005</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/25000/#p25000" />
			<content type="html"><![CDATA[<p>The answer is simple here. If &quot;High[iBar] - Low[iBar]&quot; = 0, we&#039;ll receive <strong>Deviation by zero</strong> error. <br />Since we compare double numbers we cannot use 0 for comparison. That&#039;s why Point is used as a minimal value (instead of zero).<br />Otherwise the code should be <br /></p><div class="codebox"><pre><code>Sigma = Point;
if(Math.Abs((High[iBar] - Low[iBar])-0) &gt; Sigma) ...</code></pre></div><p>Most probably High[iBar] is always greater or equal to&nbsp; Low[iBar]. That&#039;s why the code is simplified to <br /></p><div class="codebox"><pre><code>if (High[iBar] - Low[iBar] &gt; Point)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2014-05-08T05:09:40Z</updated>
			<id>https://forexsb.com/forum/post/25000/#p25000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/24998/#p24998" />
			<content type="html"><![CDATA[<p>The function? To define a movement bigger of at least 1 point or 1/10 of a point, depending on digits. To answer existential questions turn to a decent search engine and find the author and the concept behind the indicator.</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2014-05-07T21:47:25Z</updated>
			<id>https://forexsb.com/forum/post/24998/#p24998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Questions About ambiguous Codes inside indicators '' Why & What]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/24997/#p24997" />
			<content type="html"><![CDATA[<p>Sometimes i see some small parts inside codes and donot know why they are here and what they are doing&nbsp; i will post my Questions here and i hope answers will help </p><p>1st Question: In Balance of Power Indicator <br /></p><div class="codebox"><pre><code>// Calculation
            int iFirstBar = iPeriod + 2;

            var adBop = new double[Bars];

            for (int iBar = 1; iBar &lt; Bars; iBar++)
            {
                if (High[iBar] - Low[iBar] &gt; Point)
                    adBop[iBar] = (Close[iBar] - Open[iBar])/(High[iBar] - Low[iBar]);
                else
                    adBop[iBar] = 0;
            }

            adBop = MovingAverage(iPeriod, 0, maMethod, adBop);</code></pre></div><p>Why&nbsp; if (High[iBar] - Low[iBar] &gt; Point) exist and what is the function of it ?</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2014-05-07T20:59:07Z</updated>
			<id>https://forexsb.com/forum/post/24997/#p24997</id>
		</entry>
</feed>
