<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — How to add shift to bands indicators]]></title>
		<link>https://forexsb.com/forum/topic/4551/how-to-add-shift-to-bands-indicators/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/4551/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to add shift to bands indicators.]]></description>
		<lastBuildDate>Mon, 09 Dec 2013 12:33:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22951/#p22951</link>
			<description><![CDATA[<p>That&#039;s weird. It can&#039;t be that it doesn&#039;t work. Hmm...</p><p>Keep my suggestion, shift only the band itself and change the starting point of the for loop like below:</p><div class="codebox"><pre><code>for (int bar = firstBar; bar &lt; Bars - iShift; bar++)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Mon, 09 Dec 2013 12:33:31 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22951/#p22951</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22937/#p22937</link>
			<description><![CDATA[<div class="quotebox"><cite>footon wrote:</cite><blockquote><p>Oops, sorry, I misread you. You want bar shifts. </p><p>No need to shift adMa, you should shift the whole band only. </p><p>This should be what you&#039;re looking for.</p><div class="codebox"><pre><code>adUpBand[bar + iShift] = adMA[bar] + mpl* stdDev;
adDnBand[bar + iShift] = adMA[bar] - mpl * stdDev;</code></pre></div></blockquote></div><p>i tried it before but not working !!!</p>]]></description>
			<author><![CDATA[null@example.com (ahmedalhoseny)]]></author>
			<pubDate>Mon, 09 Dec 2013 04:52:12 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22937/#p22937</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22932/#p22932</link>
			<description><![CDATA[<p>Oops, sorry, I misread you. You want bar shifts. </p><p>No need to shift adMa, you should shift the whole band only. </p><p>This should be what you&#039;re looking for.</p><div class="codebox"><pre><code>adUpBand[bar + iShift] = adMA[bar] + mpl* stdDev;
adDnBand[bar + iShift] = adMA[bar] - mpl * stdDev;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Sat, 07 Dec 2013 20:08:30 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22932/#p22932</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22931/#p22931</link>
			<description><![CDATA[<p>and this what i have done&nbsp; in the previous post these changes i have done&nbsp; but visually after i plot on screen there are differences !!!!</p><br /><p>I think the problem in the StDev part but couldnot figure how tofix it .</p>]]></description>
			<author><![CDATA[null@example.com (ahmedalhoseny)]]></author>
			<pubDate>Sat, 07 Dec 2013 18:48:08 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22931/#p22931</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22930/#p22930</link>
			<description><![CDATA[<div class="codebox"><pre><code>IndParam.NumParam[2].Caption = &quot;Shift&quot;;
            IndParam.NumParam[2].Value = 0;
            IndParam.NumParam[2].Min = 0;
            IndParam.NumParam[2].Max = 200;
            IndParam.NumParam[2].Enabled = true;
            IndParam.NumParam[2].ToolTip = &quot;The number of bars to shift with.&quot;;

            // The CheckBox parameters
            IndParam.CheckParam[0].Caption = &quot;Use previous bar value&quot;;
            IndParam.CheckParam[0].Enabled = true;
            IndParam.CheckParam[0].ToolTip = &quot;Use the indicator value from the previous bar.&quot;;</code></pre></div><div class="codebox"><pre><code>var iShift = (int)IndParam.NumParam[2].Value;
            int prvs = IndParam.CheckParam[0].Checked ? 1 : 0;</code></pre></div><div class="codebox"><pre><code>double[] adMA = MovingAverage(nMA, iShift, maMethod, adPrice);</code></pre></div><div class="codebox"><pre><code>int firstBar = nMA + iShift + prvs + 2;

            for (int bar = nMA; bar &lt; Bars - iShift; bar++)
            {
                double sum = 0;
                for (int i = 0; i &lt; nMA; i++)
                {
                    double delta = (adPrice[bar - i] - adMA[bar]);
                    sum += delta*delta;
                }
                double stdDev = Math.Sqrt(sum/nMA);
                adUpBand[bar + iShift] = adMA[bar + iShift] + mpl* stdDev;
                adDnBand[bar + iShift] = adMA[bar + iShift] - mpl * stdDev;
            }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ahmedalhoseny)]]></author>
			<pubDate>Sat, 07 Dec 2013 18:36:24 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22930/#p22930</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22928/#p22928</link>
			<description><![CDATA[<p>Ahmed, the best way I think would be to look at other indicators with vertical shift, like Recent Swing High Low. Look how it&#039;s done, and implement it similarly (new for loop after the main one, then add the shift to upper and lower band).</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Sat, 07 Dec 2013 14:36:58 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22928/#p22928</guid>
		</item>
		<item>
			<title><![CDATA[How to add shift to bands indicators]]></title>
			<link>https://forexsb.com/forum/post/22927/#p22927</link>
			<description><![CDATA[<p>Moving average and Donch channel have shift function by bars <br />but when come to band like bollingerbands it will not work </p><p>i modified the BB indicator with shift function it compiled fine&nbsp; but the logic changed because of StDev not shifted &#039;&#039;i think&#039;&#039;&nbsp; </p><p>How to fix this obstacle</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (ahmedalhoseny)]]></author>
			<pubDate>Sat, 07 Dec 2013 12:46:07 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/22927/#p22927</guid>
		</item>
	</channel>
</rss>
