<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Inside Bar with Sunday correctuon]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/1228" />
	<updated>2009-12-21T09:54:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/1228/inside-bar-with-sunday-correctuon/</id>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/4003/#p4003" />
			<content type="html"><![CDATA[<p>I got it <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /> it really will be a complicated issue</p><p>May you help me here<br />http://forexsb.com/forum/topic/1233/use-previous-bar-value-in-entering-and-closing-positions/</p><p>thanx again</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2009-12-21T09:54:45Z</updated>
			<id>https://forexsb.com/forum/post/4003/#p4003</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/4002/#p4002" />
			<content type="html"><![CDATA[<p>This problem exists for all indicators. It can be corrected&nbsp; with special calculations for Sunday and Monday as shown above for each indicator. It is a little bit more complex taking into account not only the current Sunday but also the previous (RSI 14&nbsp; includes 2 or 3 Sundays). Another possible options is to merge preliminarily Sundays and Mondays but this will reduce the number of bars.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2009-12-21T09:36:06Z</updated>
			<id>https://forexsb.com/forum/post/4002/#p4002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/4001/#p4001" />
			<content type="html"><![CDATA[<p>Hello<br />I mean we are calculating RSI(14) , and we are in monday so it will use data from sunday to uppdate the indicator?</p><p>and now we are in tusday is it will use monday and sunday as 2 different days in the rsi calculation or it will use only ( combined monday ) = sunday + monday as one day ??<br />regards</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2009-12-21T09:23:41Z</updated>
			<id>https://forexsb.com/forum/post/4001/#p4001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/4000/#p4000" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>This indicator adjust the signals comming from price value it self but has no function with the indicators wich use the price information( like rsi ) !!!!</p></blockquote></div><p>I cannot understand you. What is the difference between price vaue and price information.</p><p>Both &quot;Inside Bar&quot; and &quot;RSI&quot; use one and the same price data:</p><div class="codebox"><pre><code>DateTime Time[Bars-1]; 
double   Open[Bars-1]; 
double   High[Bars-1]; 
double   Low[Bars-1]; 
double   Close[Bars-1]; 
int      Volume[Bars-1];</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2009-12-21T08:59:48Z</updated>
			<id>https://forexsb.com/forum/post/4000/#p4000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3998/#p3998" />
			<content type="html"><![CDATA[<p>Dear popov ( and correct me if iam wrong)</p><p>This indicator adjust the signals comming from price value it self but has no function with the indicators wich use the price information( like rsi ) !!!!</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2009-12-21T08:14:22Z</updated>
			<id>https://forexsb.com/forum/post/3998/#p3998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3997/#p3997" />
			<content type="html"><![CDATA[<p>I want to add something. It&#039;s easy to prevent entries on Sunday by adding this code in the calculation cycle.</p><div class="codebox"><pre><code>if (Time[iBar].DayOfWeek == DayOfWeek.Sunday)
{   // Today is Sunday - no entry
    adIB[iBar] = 0;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2009-12-21T08:07:55Z</updated>
			<id>https://forexsb.com/forum/post/3997/#p3997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3995/#p3995" />
			<content type="html"><![CDATA[<p>Thnx popov <br />and still testing it , it will take time because i compare the charts of FSB with my MT4 charts</p><p>Thanx again</p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2009-12-21T07:57:58Z</updated>
			<id>https://forexsb.com/forum/post/3995/#p3995</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3984/#p3984" />
			<content type="html"><![CDATA[<p>There is a side effect of this indicator:</p><p>When Thursday and Friday bars form a formation, it rises signals on Sunday and on Monday. One formation rises two signals. </p><p>You can prevent entering on Sunday by using Day of Week indicator:</p><p><strong>[Opening Logic Condition]</strong><br /><strong><span style="color:blue">Day of Week</span></strong><br />&nbsp; &nbsp; &nbsp;<strong><span style="color:teal">Enter the market between the specified days</span></strong><br />&nbsp; &nbsp; &nbsp;<strong>From (incl.)</strong>&nbsp; -&nbsp; <em>Monday</em><br />&nbsp; &nbsp; &nbsp;<strong>To (excl.)</strong>&nbsp; -&nbsp; <em>Saturday</em></p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2009-12-19T15:16:56Z</updated>
			<id>https://forexsb.com/forum/post/3984/#p3984</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3983/#p3983" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>EX: if we scan all daily candles for narrow range formation or inside bar and we find that Friday candle is inside day in comparison to thursday , so we ignore the sunday candle from calculation and combine both sunday and monday together in calculation</p></blockquote></div><p>Done.</p><p>First post and indicator corrected.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2009-12-19T14:30:08Z</updated>
			<id>https://forexsb.com/forum/post/3983/#p3983</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3981/#p3981" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>If your broker starts quotation on Sunday, a short bars appear in the historical rates on a daily chart. <strong>This bar together with the following Monday bar forms an Inside Bar formation</strong>. To prevent this ahmedalhoseny suggested the Sunday bar to included in the Monday bar.</p><p>The &quot;Inside Bar Sun&quot; custom indicator checks the bar&#039;s date and if it&#039;s Monday that follows a Sunday bar, it merges the two bars (only to calculates the signal).</p></blockquote></div><p>Hello Again <br />the sunday bar forms an inside day in comparison with previous friday not with next monday , am i right ?????<br />My idea is : we ignore all sunday candles when look for any narrow range formation <br />EX: if we scan all daily candles for narrow range formation or inside bar and we find that Friday candle is inside day in comparison to thursday , so we ignore the sunday candle from calculation and combine both sunday and monday together in calculation</p><br /><p>Also when calculate any indicator like RSI we should use the new data from the ( combined new monday OHLC data )</p><p><a href="http://www.postimage.org/image.php?v=PqqXCLJ"><span class="postimg"><img src="http://s3.postimage.org/qXCLJ.jpg" alt="http://s3.postimage.org/qXCLJ.jpg" /></span></a></p><p><a href="http://www.postimage.org/image.php?v=PqqXMKi"><span class="postimg"><img src="http://s3.postimage.org/qXMKi.jpg" alt="http://s3.postimage.org/qXMKi.jpg" /></span></a></p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2009-12-19T11:15:56Z</updated>
			<id>https://forexsb.com/forum/post/3981/#p3981</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3980/#p3980" />
			<content type="html"><![CDATA[<p>Thaaaaaaannnnnnxxxxxxxxxx</p><p>Attached here the results of test using the new tool</p><p>But it seams that its logic to consider the sunday candle as an inside day and make its action using that logic !!!</p><p>Any clues!!</p><p>Regards</p><p><a href="http://www.postimage.org/image.php?v=gxNnz6i"><span class="postimg"><img src="http://s1.postimage.org/Nnz6i.jpg" alt="http://s1.postimage.org/Nnz6i.jpg" /></span></a></p><p><a href="http://www.postimage.org/image.php?v=PqqKDCS"><span class="postimg"><img src="http://s3.postimage.org/qKDCS.jpg" alt="http://s3.postimage.org/qKDCS.jpg" /></span></a></p><p><a href="http://www.postimage.org/image.php?v=gxNnJ4S"><span class="postimg"><img src="http://s1.postimage.org/NnJ4S.jpg" alt="http://s1.postimage.org/NnJ4S.jpg" /></span></a></p>]]></content>
			<author>
				<name><![CDATA[ahmedalhoseny]]></name>
				<uri>https://forexsb.com/forum/user/1512/</uri>
			</author>
			<updated>2009-12-19T10:32:51Z</updated>
			<id>https://forexsb.com/forum/post/3980/#p3980</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Inside Bar with Sunday correctuon]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/3978/#p3978" />
			<content type="html"><![CDATA[<p><strong>[Edited]</strong></p><p>This correction was requested and inspired by ahmedalhoseny.</p><p>If your broker starts quotation on Sunday, short bars appear in the historical rates on a daily chart. This bar together with the previous Friday bar forms an Inside Bar formation.<br />To prevent this the indicator compares Firday and Thursday in order to rise a signal on Monday.</p><p>Further to this the indicator merges the bars from Sunday and Monday before comparing with the Friday bar.</p><p>The main part of the code is:<br /></p><div class="codebox"><pre><code>// Calculation
int iFirstBar = 4;
double[] adIB = new double[Bars];

for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)
{
    if (Time[iBar].DayOfWeek == DayOfWeek.Monday &amp;&amp; Time[iBar - 1].DayOfWeek == DayOfWeek.Sunday)
    {   // Today is Monday and a Sunday bar exists
        // Friday
        double friHigh = High[iBar - 2];
        double friLow  = Low[iBar  - 2];
        // Thursday
        double thuHigh = High[iBar - 3];
        double thuLow  = Low[iBar  - 3];

        adIB[iBar] = (friHigh &lt; thuHigh &amp;&amp; friLow &gt; thuLow) ? 1 : 0;
    }
    else if (Time[iBar].DayOfWeek == DayOfWeek.Tuesday &amp;&amp; Time[iBar - 2].DayOfWeek == DayOfWeek.Sunday)
    {   // Today is Tuesday and a Sunday bar exists.
        // Monday high and low include eventual Sunday extreme.
        double monLow  = Math.Min(Low[iBar  - 1], Low[iBar  - 2]);
        double monHigh = Math.Max(High[iBar - 1], High[iBar - 2]);
        // Friday
        double friHigh = High[iBar - 3];
        double friLow  = Low[iBar  - 3];

        adIB[iBar] = (monHigh &lt; friHigh &amp;&amp; monLow &gt; friLow) ? 1 : 0;
    }
    else
        adIB[iBar] = (High[iBar - 1] &lt; High[iBar - 2] &amp;&amp; Low[iBar - 1] &gt; Low[iBar - 2]) ? 1 : 0;
}</code></pre></div><p><a href="http://www.postimage.org/image.php?v=Ts1aKNV9"><span class="postimg"><img src="http://s2.postimage.org/1aKNV9.jpg" alt="http://s2.postimage.org/1aKNV9.jpg" /></span></a></p><p>Thank you ahmedalhoseny for the feedback.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2009-12-19T09:33:39Z</updated>
			<id>https://forexsb.com/forum/post/3978/#p3978</id>
		</entry>
</feed>
