<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Bollinger Band Upgrade]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/5297/" />
	<updated>2015-04-27T16:33:16Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/5297/bollinger-band-upgrade/</id>
		<entry>
			<title type="html"><![CDATA[Re: Bollinger Band Upgrade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/28801/#p28801" />
			<content type="html"><![CDATA[<p>Attached My trial But not working </p><p>Any help making it work !!!!</p><br /><p>Thnx</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2015-04-27T16:33:16Z</updated>
			<id>https://forexsb.com/forum/post/28801/#p28801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bollinger Band Upgrade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/28794/#p28794" />
			<content type="html"><![CDATA[<p>I tryed this step by combining the MA and bollinger bands open close slots but it didnot work<br />So how to merge this MA code with the code in the previous post !!!!</p><div class="codebox"><pre><code>if (SlotType == SlotTypes.Open || SlotType == SlotTypes.Close)
            {
                Component = new IndicatorComp[2];

                Component[1] = new IndicatorComp {Value = new double[Bars]};

                for (int bar = firstBar; bar &lt; Bars; bar++)
                {
                    // Covers the cases when the price can pass through the MA without a signal
                    double value = movingAverage[bar - previous]; // Current value
                    double value1 = movingAverage[bar - previous - 1]; // Previous value
                    double tempVal = value;
                    if ((value1 &gt; High[bar - 1] &amp;&amp; value &lt; Open[bar]) || // The Open price jumps above the indicator
                        (value1 &lt; Low[bar - 1] &amp;&amp; value &gt; Open[bar]) || // The Open price jumps below the indicator
                        (Close[bar - 1] &lt; value &amp;&amp; value &lt; Open[bar]) || // The Open price is in a positive gap
                        (Close[bar - 1] &gt; value &amp;&amp; value &gt; Open[bar])) // The Open price is in a negative gap
                        tempVal = Open[bar];
                    Component[1].Value[bar] = tempVal; // Entry or exit value
                }
            }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2015-04-27T12:56:21Z</updated>
			<id>https://forexsb.com/forum/post/28794/#p28794</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bollinger Band Upgrade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/28793/#p28793" />
			<content type="html"><![CDATA[<p>The middle line is a Moving Average. You don&#039;t need to make the code unnecessary complex by calculating the Bands. However, if you want to do it,&nbsp; see the MA application code and include it in the BB code.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2015-04-27T12:45:24Z</updated>
			<id>https://forexsb.com/forum/post/28793/#p28793</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bollinger Band Upgrade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/28792/#p28792" />
			<content type="html"><![CDATA[<p>iam trying to use all the three lines of bollingerbands&nbsp; to be used in the 4 slots </p><p>but i faced the problem in the code part of SlotType == SlotTypes.Open || SlotType == SlotTypes.Close</p><p>it uses the upper and lower bands as interchange to each other </p><p>My problem: I cannot add the middle line to that part of code </p><p>Any help !!!</p><div class="codebox"><pre><code>  if (SlotType == SlotTypes.Open || SlotType == SlotTypes.Close)
            {
                if (nMA &gt; 1)
                {
                    for (int bar = firstBar; bar &lt; Bars; bar++)
                    {
                        // Covers the cases when the price can pass through the band without a signal.
                        double open = Open[bar]; // Current open price

                        // Upper band
                        double valueUp = adUpBand[bar - prvs]; // Current value
                        double valueUp1 = adUpBand[bar - prvs - 1]; // Previous value
                        double tempValUp = valueUp;

                        if ((valueUp1 &gt; High[bar - 1] &amp;&amp; valueUp &lt; open) || // The Open price jumps above the indicator
                            (valueUp1 &lt; Low[bar - 1] &amp;&amp; valueUp &gt; open) || // The Open price jumps below the indicator
                            (Close[bar - 1] &lt; valueUp &amp;&amp; valueUp &lt; open) || // The Open price is in a positive gap
                            (Close[bar - 1] &gt; valueUp &amp;&amp; valueUp &gt; open)) // The Open price is in a negative gap
                            tempValUp = open; // The entry/exit level is moved to Open price

                        // Lower band
                        double valueDown = adDnBand[bar - prvs]; // Current value
                        double valueDown1 = adDnBand[bar - prvs - 1]; // Previous value
                        double tempValDown = valueDown;

                        if ((valueDown1 &gt; High[bar - 1] &amp;&amp; valueDown &lt; open) ||
                            // The Open price jumps above the indicator
                            (valueDown1 &lt; Low[bar - 1] &amp;&amp; valueDown &gt; open) ||
                            // The Open price jumps below the indicator
                            (Close[bar - 1] &lt; valueDown &amp;&amp; valueDown &lt; open) || // The Open price is in a positive gap
                            (Close[bar - 1] &gt; valueDown &amp;&amp; valueDown &gt; open)) // The Open price is in a negative gap
                            tempValDown = open; // The entry/exit level is moved to Open price

                        if (IndParam.ListParam[0].Text == &quot;Enter long at Upper Band&quot; ||
                            IndParam.ListParam[0].Text == &quot;Exit long at Upper Band&quot;)
                        {
                            Component[3].Value[bar] = tempValUp;
                            Component[4].Value[bar] = tempValDown;
                        }
                        else
                        {
                            Component[3].Value[bar] = tempValDown;
                            Component[4].Value[bar] = tempValUp;
                        }
                    }
                }
                else
                {
                    for (int bar = 2; bar &lt; Bars; bar++)
                    {
                        if (IndParam.ListParam[0].Text == &quot;Enter long at Upper Band&quot; ||
                            IndParam.ListParam[0].Text == &quot;Exit long at Upper Band&quot;)
                        {
                            Component[3].Value[bar] = adUpBand[bar - prvs];
                            Component[4].Value[bar] = adDnBand[bar - prvs];
                        }
                        else
                        {
                            Component[3].Value[bar] = adDnBand[bar - prvs];
                            Component[4].Value[bar] = adUpBand[bar - prvs];
                        }
                    }
                }
            }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2015-04-27T12:41:45Z</updated>
			<id>https://forexsb.com/forum/post/28792/#p28792</id>
		</entry>
</feed>
