<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Moving Average Logic]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/2410/" />
	<updated>2011-12-24T16:39:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/2410/moving-average-logic/</id>
		<entry>
			<title type="html"><![CDATA[Re: Moving Average Logic]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11980/#p11980" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ahmedalhoseny wrote:</cite><blockquote><p>Footon , but using this condition means we override the previous bar option am i right!!!!</p></blockquote></div><p>What do you mean by it? Previous bar value usage? If you mean PBV, then it doesn&#039;t override, look at the logic calculation block:<br /></p><div class="codebox"><pre><code>protected void BarOpensAboveIndicatorAfterOpeningBelowLogic(int iFirstBar, int iPrvs, double[] adIndValue, ref IndicatorComp indCompLong, ref IndicatorComp indCompShort)
        {
            double dSigma = Sigma();
 
            for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)
            {
                int iBaseBar = iBar - 1;
                while (Math.Abs(Open[iBaseBar] - adIndValue[iBaseBar - iPrvs]) &lt; dSigma &amp;&amp; iBaseBar &gt; iFirstBar)
                { iBaseBar--; }
 
                indCompLong.Value[iBar]  = Open[iBar] &gt; adIndValue[iBar - iPrvs] + dSigma &amp;&amp; Open[iBaseBar] &lt; adIndValue[iBaseBar - iPrvs] - dSigma ? 1 : 0;
                indCompShort.Value[iBar] = Open[iBar] &lt; adIndValue[iBar - iPrvs] - dSigma &amp;&amp; Open[iBaseBar] &gt; adIndValue[iBaseBar - iPrvs] + dSigma ? 1 : 0;
            }
 
            return;
        }</code></pre></div><p>First open from current bar compared to previous bar MA, then previous open compared to MA value from the second bar from current.</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2011-12-24T16:39:52Z</updated>
			<id>https://forexsb.com/forum/post/11980/#p11980</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Moving Average Logic]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11978/#p11978" />
			<content type="html"><![CDATA[<p>Footon , but using this condition means we override the previous bar option am i right!!!!</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2011-12-24T16:16:07Z</updated>
			<id>https://forexsb.com/forum/post/11978/#p11978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Moving Average Logic]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/9714/#p9714" />
			<content type="html"><![CDATA[<p>It is previous bar opens below, current bar opens above and vice versa. Opening of the position is carried out at the beginning of the current bar, it is when we know it has opened above/below the MA. Study the charts, maybe you&#039;ll find that it does what you need after all.</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2011-07-12T10:03:46Z</updated>
			<id>https://forexsb.com/forum/post/9714/#p9714</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Moving Average Logic]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/9713/#p9713" />
			<content type="html"><![CDATA[<p>Can someone please clarify the opening logic with the Moving Average. What I am looking for is a bar that opens below the moving average and closes above it. Then I want to enter long on the next bar. So basically I will open at the open of the next bar.</p><p>One of the logic settings in Moving Average is &quot;The bar opens below the moving average after opening above it&quot; which is really a contradiction. </p><p>What exactly does this logic mean because it can&#039;t open below and above at the same time, can it?</p>]]></content>
			<author>
				<name><![CDATA[SpiderMan]]></name>
				<uri>https://forexsb.com/forum/user/4094/</uri>
			</author>
			<updated>2011-07-12T08:03:38Z</updated>
			<id>https://forexsb.com/forum/post/9713/#p9713</id>
		</entry>
</feed>
