<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — request a indicator that Exit at certain hours or minutes after trade]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/9625/" />
	<updated>2023-12-11T17:55:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/9625/request-a-indicator-that-exit-at-certain-hours-or-minutes-after-trade/</id>
		<entry>
			<title type="html"><![CDATA[Re: request a indicator that Exit at certain hours or minutes after trade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/77917/#p77917" />
			<content type="html"><![CDATA[<p>I don&#039;t understand, do you want a custom indicator or you are trying to modify exported EAs?</p><p>Secondly, is this about defining a trading session? You said you want to close positions after certain time has passed. N-bar indi works well for that in most cases. If you are trying to limit trading time then use Entry Time indi.</p><div class="quotebox"><cite>SurfingWave wrote:</cite><blockquote><p>Tried your suggestion fall short. </p><p>trade at certain time base on Server trade starts 8am to 1pm. </p><p>here my ChatGpT code: </p><br /><p>// YourMainScriptOrIndicator.mq4<br />#include &quot;TradingTimeFunctions.mqh&quot;</p><p>// Trading hours in server time (in hours)<br />int tradingStartTime = 8;<br />int tradingEndTime = 13;</p><p>// The start function<br />int start()<br />{<br />&nbsp; &nbsp; // Check if trading is allowed<br />&nbsp; &nbsp; if (IsTradingAllowed(tradingStartTime, tradingEndTime))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; // Trading is allowed during these hours<br />&nbsp; &nbsp; &nbsp; &nbsp; Print(&quot;Trading is allowed. Current server time: &quot;, TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; // Trading is not allowed outside these hours<br />&nbsp; &nbsp; &nbsp; &nbsp; Print(&quot;Trading is not allowed. Current server time: &quot;, TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; return 0;<br />}</p><br /><p>Because, I&#039;m lacking of coding knowledge. I wanna make sure this code works in FSB pro. I willing to pay for the service pm me lets negotiate. Pardon my grammar second language. </p><div class="quotebox"><cite>SurfingWave wrote:</cite><blockquote><div class="quotebox"><cite>footon wrote:</cite><blockquote><p>No, indicators don&#039;t have access to position info, so it can&#039;t be done. You can though use N-bar Exit as a sort of workaround.</p></blockquote></div><p>Thanks! Will try your suggestions.</p></blockquote></div></blockquote></div>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2023-12-11T17:55:01Z</updated>
			<id>https://forexsb.com/forum/post/77917/#p77917</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: request a indicator that Exit at certain hours or minutes after trade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/77914/#p77914" />
			<content type="html"><![CDATA[<p>Tried your suggestion fall short. </p><p>trade at certain time base on Server trade starts 8am to 1pm. </p><p>here my ChatGpT code: <br /></p><div class="codebox"><pre><code>// YourMainScriptOrIndicator.mq4
#include &quot;TradingTimeFunctions.mqh&quot;

// Trading hours in server time (in hours)
int tradingStartTime = 8;
int tradingEndTime = 13;

// The start function
int start()
{
    // Check if trading is allowed
    if (IsTradingAllowed(tradingStartTime, tradingEndTime))
    {
        // Trading is allowed during these hours
        Print(&quot;Trading is allowed. Current server time: &quot;, TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));
    }
    else
    {
        // Trading is not allowed outside these hours
        Print(&quot;Trading is not allowed. Current server time: &quot;, TimeToStr(GetCurrentServerTime(), TIME_DATE | TIME_MINUTES));
    }

    return 0;
}</code></pre></div><p>Because, I&#039;m lacking of coding knowledge. I wanna make sure this code works in FSB pro. I willing to pay for the service pm me lets negotiate. Pardon my grammar second language. </p><div class="quotebox"><cite>SurfingWave wrote:</cite><blockquote><div class="quotebox"><cite>footon wrote:</cite><blockquote><div class="quotebox"><cite>SurfingWave wrote:</cite><blockquote><p>Hi Footon</p><p>Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made? </p><p>Thank!</p></blockquote></div><p>No, indicators don&#039;t have access to position info, so it can&#039;t be done. You can though use N-bar Exit as a sort of workaround.</p></blockquote></div><p>Thanks! Will try your suggestions.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[SurfingWave]]></name>
				<uri>https://forexsb.com/forum/user/14273/</uri>
			</author>
			<updated>2023-12-11T16:22:17Z</updated>
			<id>https://forexsb.com/forum/post/77914/#p77914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: request a indicator that Exit at certain hours or minutes after trade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/77653/#p77653" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>footon wrote:</cite><blockquote><div class="quotebox"><cite>SurfingWave wrote:</cite><blockquote><p>Hi Footon</p><p>Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made? </p><p>Thank!</p></blockquote></div><p>No, indicators don&#039;t have access to position info, so it can&#039;t be done. You can though use N-bar Exit as a sort of workaround.</p></blockquote></div><p>Thanks! Will try your suggestions.</p>]]></content>
			<author>
				<name><![CDATA[SurfingWave]]></name>
				<uri>https://forexsb.com/forum/user/14273/</uri>
			</author>
			<updated>2023-11-23T02:25:32Z</updated>
			<id>https://forexsb.com/forum/post/77653/#p77653</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: request a indicator that Exit at certain hours or minutes after trade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/77645/#p77645" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>SurfingWave wrote:</cite><blockquote><p>Hi Footon</p><p>Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made? </p><p>Thank!</p></blockquote></div><p>No, indicators don&#039;t have access to position info, so it can&#039;t be done. You can though use N-bar Exit as a sort of workaround.</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2023-11-22T11:49:32Z</updated>
			<id>https://forexsb.com/forum/post/77645/#p77645</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[request a indicator that Exit at certain hours or minutes after trade]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/77634/#p77634" />
			<content type="html"><![CDATA[<p>Hi Footon</p><p>Would be possible to request a indicator that Exit at certain hours or minutes after the trade are made? </p><p>Thank!</p>]]></content>
			<author>
				<name><![CDATA[SurfingWave]]></name>
				<uri>https://forexsb.com/forum/user/14273/</uri>
			</author>
			<updated>2023-11-22T07:14:11Z</updated>
			<id>https://forexsb.com/forum/post/77634/#p77634</id>
		</entry>
</feed>
