<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Suspend and delay signals when market is off around midnight]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/7979/" />
	<updated>2022-01-04T11:34:15Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/7979/suspend-and-delay-signals-when-market-is-off-around-midnight/</id>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/67438/#p67438" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>Hello traders,</p><p>I want to add a fix in the EA&#039;s code to work around the problem with the brokers that suspend the trading around midnight for swap calculations.</p><p>The problem appears when we trade mostly on D1, H4, or H1 charts and the strategy has a signal at 00:00 but the market is off.</p><p>A possible solution is to &quot;remember&quot; the signals and execute it when the market is open.</p><p>We have to add some limitations for how long the signal can be delayed. </p><p>A possible workflow is:<br /> - save the signal if the market is closed<br /> - periodically check if the market is open (let&#039;s say every 15 seconds)<br /> - send the order if the market is open.<br /> - cancel the signal if the market is closed for longer than N minutes. Log a message.</p><p>I also want to have a predefined time for this procedure. Let&#039;s say:</p><br /><p>We can add these options in the EA Studio&#039;s Settings. Something like that:<br />&nbsp; [ V ] Enable signal delay on Market Closed<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Expected Market Closed time start:&nbsp; 23:55<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Expected Market Closed time end:&nbsp; &nbsp;00:05<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Maximum time for signal delay in minutes: 2.0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Retry interval in seconds: 15</p><p>Please share your opinion.</p><p>If you have a working code, please share it. It will help us to come with a faster and more stable solution.</p></blockquote></div><p>did you have implemented this?</p>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2022-01-04T11:34:15Z</updated>
			<id>https://forexsb.com/forum/post/67438/#p67438</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/65270/#p65270" />
			<content type="html"><![CDATA[<p>can we use the spread pro andicator ? do not enter a position when the spread is above the 22 for example...<br />then the position wont be open at midnight... <br />but still there is a problem and that is when you set the spread in symbol details at 22 the FSB app think that the spread is always at 22 .</p>]]></content>
			<author>
				<name><![CDATA[dotacool]]></name>
				<uri>https://forexsb.com/forum/user/13262/</uri>
			</author>
			<updated>2021-06-04T17:11:03Z</updated>
			<id>https://forexsb.com/forum/post/65270/#p65270</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/65253/#p65253" />
			<content type="html"><![CDATA[<p>hi <br />when i check the jornal i see that the strategy opens a long position at 00.05 but in real live acc at 00.5 opens a short is the problem is related to this topic?<br />how to solve it?</p>]]></content>
			<author>
				<name><![CDATA[chelbeastsea]]></name>
				<uri>https://forexsb.com/forum/user/13212/</uri>
			</author>
			<updated>2021-06-04T08:27:36Z</updated>
			<id>https://forexsb.com/forum/post/65253/#p65253</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/65055/#p65055" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Arc wrote:</cite><blockquote><p>Did this ever receive an implementation? I encountered the issue tonight where trades weren&#039;t opened during rollover</p></blockquote></div><p>I am having the same issue</p>]]></content>
			<author>
				<name><![CDATA[lance298]]></name>
				<uri>https://forexsb.com/forum/user/13160/</uri>
			</author>
			<updated>2021-05-14T11:54:35Z</updated>
			<id>https://forexsb.com/forum/post/65055/#p65055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/65020/#p65020" />
			<content type="html"><![CDATA[<p>Did this ever receive an implementation? I encountered the issue tonight where trades weren&#039;t opened during rollover</p>]]></content>
			<author>
				<name><![CDATA[Arc]]></name>
				<uri>https://forexsb.com/forum/user/13205/</uri>
			</author>
			<updated>2021-05-11T22:50:25Z</updated>
			<id>https://forexsb.com/forum/post/65020/#p65020</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/57291/#p57291" />
			<content type="html"><![CDATA[<p>Sleep, may not work well because it effectively suspends the complete expert.</p><p>I think fo saving the signal&#039;s details and re-sending in particular time interval.</p><p>The idea of eacoder of checking the price shift is very good for the robustness of the expert.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2019-09-27T18:15:51Z</updated>
			<id>https://forexsb.com/forum/post/57291/#p57291</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/57290/#p57290" />
			<content type="html"><![CDATA[<p>When do you plan to implement this feature?</p><p>I think such code before all ordersend, orderclose, ordermodify can work:<br />if (Hour() == XX &amp;&amp; (Minute() &gt;= Y1 &amp;&amp; Minute()&lt;=Y2)) Sleep((Y2-Minute())*1000);<br />where market is closed at XX hours between Y1 and Y2 minutes</p>]]></content>
			<author>
				<name><![CDATA[Finmod123]]></name>
				<uri>https://forexsb.com/forum/user/11348/</uri>
			</author>
			<updated>2019-09-27T17:42:48Z</updated>
			<id>https://forexsb.com/forum/post/57290/#p57290</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/57177/#p57177" />
			<content type="html"><![CDATA[<p>Finally, we&#039;ve been waiting for this.</p><p>I think the best way of doing this is to add parameter MaxPriceDeviation = 0.1 which is 0.1% of the open price.<br />When the market is available again the EA will place the trade only if the entry price is within 0.1% range. Otherwise, the signal is missed.</p><br /><p>&gt; - cancel the signal if the market is closed for longer than N minutes. Log a message.</p><p>I do not think this is a good idea, especially in 2 minutes time. Markets might be closed for rollover for 20 minutes. With GBE brokers that&#039;s normal. And when the markets are back again the price might be very reasonable.</p><p>This problem of market rollover is mostly affected when trading on Daily timeframe, so there&#039;s practically no chance that the entry rules changes in 20 or even 60 minutes. So if the price is reasonable the trade should be executed.</p><br /><p>For lower timeframes, for example, M15, the chance of getting an entry at 00:00 is very small compared to trading on Daily timeframes. But it will happen indeed, so it would be wise to check if the entry rules are still met.</p><br /><p>When OrderSend receives error 132 it means market is closed and it is a possible rollover.<br />The following code confirms if it is a rollover:</p><p>if(err == 132 &amp;&amp; DayOfWeek() != 6 &amp;&amp; Hour() == 0 &amp;&amp; Minute() &lt;= 30)</p><p>Hope this helps.</p>]]></content>
			<author>
				<name><![CDATA[eacoder]]></name>
				<uri>https://forexsb.com/forum/user/10317/</uri>
			</author>
			<updated>2019-09-20T13:29:21Z</updated>
			<id>https://forexsb.com/forum/post/57177/#p57177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/57174/#p57174" />
			<content type="html"><![CDATA[<p>I posed this problem years ago, now that trading is my only job I try to give advice: &quot;save the signal if the market is closed&quot; is the only answer that makes sense to me. No software corrects the swap and spread problem in the cfd and forex, as a result all the strategies become distorted. Is necessary the transition from automatic to quantitative-discretionary trading.<br />It would be better to focus on something else</p><p>Ragards</p>]]></content>
			<author>
				<name><![CDATA[D5QM54S7]]></name>
				<uri>https://forexsb.com/forum/user/9565/</uri>
			</author>
			<updated>2019-09-20T11:01:44Z</updated>
			<id>https://forexsb.com/forum/post/57174/#p57174</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Suspend and delay signals when market is off around midnight]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/57170/#p57170" />
			<content type="html"><![CDATA[<p>Hello traders,</p><p>I want to add a fix in the EA&#039;s code to work around the problem with the brokers that suspend the trading around midnight for swap calculations.</p><p>The problem appears when we trade mostly on D1, H4, or H1 charts and the strategy has a signal at 00:00 but the market is off.</p><p>A possible solution is to &quot;remember&quot; the signals and execute it when the market is open.</p><p>We have to add some limitations for how long the signal can be delayed. </p><p>A possible workflow is:<br /> - save the signal if the market is closed<br /> - periodically check if the market is open (let&#039;s say every 15 seconds)<br /> - send the order if the market is open.<br /> - cancel the signal if the market is closed for longer than N minutes. Log a message.</p><p>I also want to have a predefined time for this procedure. Let&#039;s say:</p><br /><p>We can add these options in the EA Studio&#039;s Settings. Something like that:<br />&nbsp; [ V ] Enable signal delay on Market Closed<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Expected Market Closed time start:&nbsp; 23:55<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Expected Market Closed time end:&nbsp; &nbsp;00:05<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Maximum time for signal delay in minutes: 2.0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Retry interval in seconds: 15</p><p>Please share your opinion.</p><p>If you have a working code, please share it. It will help us to come with a faster and more stable solution.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2019-09-20T08:27:41Z</updated>
			<id>https://forexsb.com/forum/post/57170/#p57170</id>
		</entry>
</feed>
