<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Problem:  IsOutOfSession always returns 'true']]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/6806/" />
	<updated>2017-08-08T20:45:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/6806/problem-isoutofsession-always-returns-true/</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem:  IsOutOfSession always returns 'true']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/45396/#p45396" />
			<content type="html"><![CDATA[<p>Excellent -- thank you, Popov.</p>]]></content>
			<author>
				<name><![CDATA[sleytus]]></name>
				<uri>https://forexsb.com/forum/user/9721/</uri>
			</author>
			<updated>2017-08-08T20:45:01Z</updated>
			<id>https://forexsb.com/forum/post/45396/#p45396</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem:  IsOutOfSession always returns 'true']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/45391/#p45391" />
			<content type="html"><![CDATA[<p>Please reload EA Studio.</p><p>You will see the Trading Session settings. After exporting the EA again, it will have the time set there.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-08-08T19:16:53Z</updated>
			<id>https://forexsb.com/forum/post/45391/#p45391</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem:  IsOutOfSession always returns 'true']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/45387/#p45387" />
			<content type="html"><![CDATA[<p>At the beginning of the expert I see the following:</p><p>// Session time is set in seconds from 00:00<br />int sessionSundayOpen&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7777001;<br />int sessionSundayClose&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 7777002;<br />int sessionMondayThursdayOpen&nbsp; &nbsp;= 7777003;<br />int sessionMondayThursdayClose&nbsp; = 7777004;<br />int sessionFridayOpen&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7777005;<br />int sessionFridayClose&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 7777006;<br />bool sessionIgnoreSunday&nbsp; &nbsp; &nbsp; &nbsp; = 7777007;<br />bool sessionCloseAtSessionClose = 7777008;<br />bool sessionCloseAtFridayClose&nbsp; = 7777009;</p><p>But I&#039;m not sure what to do with these.</p><p>In my currently running EA Studio when I look under Tools / Settings it only shows Account Info.&nbsp; There is nothing about &#039;Trading Session&#039;.</p>]]></content>
			<author>
				<name><![CDATA[sleytus]]></name>
				<uri>https://forexsb.com/forum/user/9721/</uri>
			</author>
			<updated>2017-08-08T18:59:45Z</updated>
			<id>https://forexsb.com/forum/post/45387/#p45387</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem:  IsOutOfSession always returns 'true']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/45385/#p45385" />
			<content type="html"><![CDATA[<p>Please see the session times and settings at the beginning of the expert.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-08-08T18:47:22Z</updated>
			<id>https://forexsb.com/forum/post/45385/#p45385</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem:  IsOutOfSession always returns 'true']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/45384/#p45384" />
			<content type="html"><![CDATA[<p>A bit more information...</p><p>In the same account I have two other Portfolio EAs running and they are doing fine.&nbsp; The other two were created a few weeks ago and their OnBar() does not include a call to IsOutOfSession().&nbsp; Only the new Portfolio EA (that I created a few days ago) checks for IsOutOfSession() and it is the only EA that doesn&#039;t trade.</p>]]></content>
			<author>
				<name><![CDATA[sleytus]]></name>
				<uri>https://forexsb.com/forum/user/9721/</uri>
			</author>
			<updated>2017-08-08T18:12:19Z</updated>
			<id>https://forexsb.com/forum/post/45384/#p45384</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem:  IsOutOfSession always returns 'true']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/45383/#p45383" />
			<content type="html"><![CDATA[<p>I created a new EURUSD, H1,&nbsp; Portfolio Expert with nearly 100 strategies -- and it never trades.&nbsp; In the past, when I&#039;ve created similar EAs there would be between 10-30 trades per day.</p><p>I added a few Print statements to the code and it appears that IsOutOfSession() always returns &#039;true&#039;.&nbsp; IsOutOfSession() checks for &#039;weekDay&#039; and then sets &#039;skipTrade&#039; to true or false.&nbsp; In my case it appears to always get set to &#039;true&#039;.</p><div class="codebox"><pre><code>   else if(weekDay&lt;5)
     {
      int lastBarFix=sessionCloseAtSessionClose ? periodLength : 0;
      skipTrade=timeFromMidnight&lt;sessionMondayThursdayOpen || timeFromMidnight+lastBarFix&gt;sessionMondayThursdayClose;
     }</code></pre></div><p>When IsOutOfSession() returns &#039;true&#039; then it immediately returns from OnBar() and trading will never occur.&nbsp; </p><p>Is this a bug or do I have some setting that is wrong.&nbsp; Thanks...</p>]]></content>
			<author>
				<name><![CDATA[sleytus]]></name>
				<uri>https://forexsb.com/forum/user/9721/</uri>
			</author>
			<updated>2017-08-08T17:32:22Z</updated>
			<id>https://forexsb.com/forum/post/45383/#p45383</id>
		</entry>
</feed>
