<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Daily Strategy does not open trades because of "closed market"]]></title>
		<link>https://forexsb.com/forum/topic/7854/daily-strategy-does-not-open-trades-because-of-closed-market/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/7854/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Daily Strategy does not open trades because of "closed market".]]></description>
		<lastBuildDate>Sun, 16 Jun 2019 15:36:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55974/#p55974</link>
			<description><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>Detecting Tester mode is easy. </p><p>Do that modification work well on all timeframes?</p><br /><p>Fixed `OnTick` function:</p><div class="codebox"><pre><code>void OnTick()
  {
   // Modification: Check if trading is allowed
   if(!IsTesting() &amp;&amp; !MarketInfo(_Symbol, MODE_TRADEALLOWED)) return;

   if(Time[0]&gt;barTime)
     {
      barTime=Time[0];
      OnBar();
     }
  }</code></pre></div></blockquote></div><p>Hi Popov :-). </p><p>I haven&#039;t tested the &#039;On Tick&#039; modification on shorter timeframes as I only trade live on D1....so not sure.</p><p>Thanks for the enhanced code.</p><p>Cheers</p><p>Rich B</p>]]></description>
			<author><![CDATA[null@example.com (ats118765)]]></author>
			<pubDate>Sun, 16 Jun 2019 15:36:36 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55974/#p55974</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55968/#p55968</link>
			<description><![CDATA[<p>Detecting Tester mode is easy. </p><p>Do that modification work well on all timeframes?</p><br /><p>Fixed `OnTick` function:</p><div class="codebox"><pre><code>void OnTick()
  {
   // Modification: Check if trading is allowed
   if(!IsTesting() &amp;&amp; !MarketInfo(_Symbol, MODE_TRADEALLOWED)) return;

   if(Time[0]&gt;barTime)
     {
      barTime=Time[0];
      OnBar();
     }
  }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Sun, 16 Jun 2019 04:00:14 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55968/#p55968</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55967/#p55967</link>
			<description><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>It is a nice idea. If it works well, I may add it in the standard code.</p></blockquote></div><p>I use this for real and demo accounts in MT4 but not for backtest strategies. Once the code is adjusted it won&#039;t work in Strategy Tester. You therefore need to include 2 types of &#039;On tick&#039; code elements if you want it to work in both MT4 environments (one for strategy tester - eg. the current standard code generated by EA Studio) and this separate code for (live/demo accounts).</p><p>Cheers</p><p>RichB</p>]]></description>
			<author><![CDATA[null@example.com (ats118765)]]></author>
			<pubDate>Sun, 16 Jun 2019 03:56:24 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55967/#p55967</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55965/#p55965</link>
			<description><![CDATA[<p>It is a nice idea. If it works well, I may add it in the standard code.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Sat, 15 Jun 2019 18:24:49 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55965/#p55965</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55964/#p55964</link>
			<description><![CDATA[<div class="quotebox"><cite>mkowa wrote:</cite><blockquote><div class="quotebox"><cite>ats118765 wrote:</cite><blockquote><p>Try this.</p></blockquote></div><p>Thank you very much. I will try!</p></blockquote></div><p>It is working for me. Thank you very much.</p>]]></description>
			<author><![CDATA[null@example.com (mkowa)]]></author>
			<pubDate>Sat, 15 Jun 2019 17:26:39 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55964/#p55964</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55913/#p55913</link>
			<description><![CDATA[<div class="quotebox"><cite>ats118765 wrote:</cite><blockquote><p>Try this.</p></blockquote></div><p>Thank you very much. I will try!</p>]]></description>
			<author><![CDATA[null@example.com (mkowa)]]></author>
			<pubDate>Thu, 13 Jun 2019 07:37:23 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55913/#p55913</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55908/#p55908</link>
			<description><![CDATA[<div class="quotebox"><cite>mkowa wrote:</cite><blockquote><p>Hi,<br />I downloaded daily data from EURTRY and got some wonderful strategies with EA Studio. However my broker never opens trades because at the beginning of any new daily bar &quot;the market is closed&quot;. A bit later it opens again but the EA is ready for that day then!<br />Is there&nbsp; any possibility to open trades some minutes earlier or later? Or should I try other timeframes?<br />Thank you for helping me outsmarting the brokers who always outsmarting me!</p></blockquote></div><p>Try this.</p><p>Modify the existing code in Metaeditor for the void OnTick() in the Portfolio compilation or single strategy with the following code. Recompile and then run. </p><p>I use this for Pepperstone for D1 as some trades were not initiated on open using the native code from the portfolio compiler.</p><br /><p>void OnTick()<br />&nbsp; {<br />&nbsp; &nbsp;if(Time[0]&gt;barTime &amp;&amp; MarketInfo(_Symbol, MODE_TRADEALLOWED) )<br />&nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; barTime=Time[0];<br />&nbsp; &nbsp; &nbsp; OnBar();<br />&nbsp; &nbsp; &nbsp;}<br />&nbsp; }</p>]]></description>
			<author><![CDATA[null@example.com (ats118765)]]></author>
			<pubDate>Thu, 13 Jun 2019 02:38:06 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55908/#p55908</guid>
		</item>
		<item>
			<title><![CDATA[Re: Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55905/#p55905</link>
			<description><![CDATA[<p>There is&nbsp; indicator&nbsp; - Entry time&nbsp; that should fix the difficulty</p>]]></description>
			<author><![CDATA[null@example.com (Blaiserboy)]]></author>
			<pubDate>Wed, 12 Jun 2019 22:27:02 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55905/#p55905</guid>
		</item>
		<item>
			<title><![CDATA[Daily Strategy does not open trades because of "closed market"]]></title>
			<link>https://forexsb.com/forum/post/55904/#p55904</link>
			<description><![CDATA[<p>Hi,<br />I downloaded daily data from EURTRY and got some wonderful strategies with EA Studio. However my broker never opens trades because at the beginning of any new daily bar &quot;the market is closed&quot;. A bit later it opens again but the EA is ready for that day then!<br />Is there&nbsp; any possibility to open trades some minutes earlier or later? Or should I try other timeframes?<br />Thank you for helping me outsmarting the brokers who always outsmarting me!</p>]]></description>
			<author><![CDATA[null@example.com (mkowa)]]></author>
			<pubDate>Wed, 12 Jun 2019 21:23:40 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/55904/#p55904</guid>
		</item>
	</channel>
</rss>
