<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/6572/" />
	<updated>2019-03-23T08:28:37Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/6572/modification-to-stop-opening-new-trades-when-equity-below-x-amount/</id>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/54820/#p54820" />
			<content type="html"><![CDATA[<p>I say that the same idea can be used in the Portfolio Experts. Of course, the portfolio can have multiple positions open, and the modification can manage that. </p><p>&quot;postType&quot; variable can be replaced with a function that gives if there is an open position at the moment. <br />&quot;ManageClose&quot; must be a function that can close all open positions of the portfolio. Be careful to take into account the Base_Magic_Number to leave the strategies from the other Portfolios intact.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2019-03-23T08:28:37Z</updated>
			<id>https://forexsb.com/forum/post/54820/#p54820</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/54818/#p54818" />
			<content type="html"><![CDATA[<p>Hi Popov</p><p>The code is giving me the same errors;</p><p>posType -undeclared identifier<br />ManageClose - function not defined</p><p>Can you assist to take a look? And could you code it in % of equity?</p><p>Thank you.</p>]]></content>
			<author>
				<name><![CDATA[BK777]]></name>
				<uri>https://forexsb.com/forum/user/9994/</uri>
			</author>
			<updated>2019-03-23T04:28:19Z</updated>
			<id>https://forexsb.com/forum/post/54818/#p54818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49624/#p49624" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>Yes, it must work.</p></blockquote></div><br /><p>hmm doesnt work When i add code and compile than i get following errors:</p><p>posType -undeclared identifier<br />ManageClose - function not defined</p>]]></content>
			<author>
				<name><![CDATA[deadlef]]></name>
				<uri>https://forexsb.com/forum/user/9894/</uri>
			</author>
			<updated>2018-03-18T15:13:18Z</updated>
			<id>https://forexsb.com/forum/post/49624/#p49624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49623/#p49623" />
			<content type="html"><![CDATA[<p>Yes, it must work.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2018-03-18T14:36:14Z</updated>
			<id>https://forexsb.com/forum/post/49623/#p49623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49607/#p49607" />
			<content type="html"><![CDATA[<p>is this working with portfolio?</p>]]></content>
			<author>
				<name><![CDATA[deadlef]]></name>
				<uri>https://forexsb.com/forum/user/9894/</uri>
			</author>
			<updated>2018-03-16T15:53:21Z</updated>
			<id>https://forexsb.com/forum/post/49607/#p49607</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/42432/#p42432" />
			<content type="html"><![CDATA[<p>Great! thanks <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[yonkuro]]></name>
				<uri>https://forexsb.com/forum/user/8447/</uri>
			</author>
			<updated>2017-03-23T04:38:58Z</updated>
			<id>https://forexsb.com/forum/post/42432/#p42432</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/42427/#p42427" />
			<content type="html"><![CDATA[<p>Yes, your code may work.</p><p>Here is a little bit improved version that closes the current position and also closes the expert.</p><div class="codebox"><pre><code>static input double MinimumEquity = 600; // Minimum Equity


void OnTick()
  {
     ...
   
   double equity = AccountEquity();
   if (equity &lt; MinimumEquity) 
     {
       if (posType!=OP_FLAT)
         {
           ManageClose();
         }
       ExpertRemove();     
     }
  }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-03-22T21:00:15Z</updated>
			<id>https://forexsb.com/forum/post/42427/#p42427</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/42407/#p42407" />
			<content type="html"><![CDATA[<p>Oke I solved it, I just need to add something like this<br /></p><div class="codebox"><pre><code>   static input int Minimum_Balance=500;                                // Minimum Balance</code></pre></div><p>and this<br /></p><div class="codebox"><pre><code>      if (AccountFreeMargin()&lt;Minimum_Balance) 
      {
       Print(&quot;We have no money.&quot;,  &quot; Error code=&quot;,GetLastError());
       return;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[yonkuro]]></name>
				<uri>https://forexsb.com/forum/user/8447/</uri>
			</author>
			<updated>2017-03-22T12:01:17Z</updated>
			<id>https://forexsb.com/forum/post/42407/#p42407</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Modification to Stop Opening New Trades When Equity Below X Amount]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/42373/#p42373" />
			<content type="html"><![CDATA[<p>Hi Popov</p><p>is there anyway to make the EA stop opening new trades when equity is below X amount? <br />I want the X amount appears on the EA parameters.</p><p>Regards.</p>]]></content>
			<author>
				<name><![CDATA[yonkuro]]></name>
				<uri>https://forexsb.com/forum/user/8447/</uri>
			</author>
			<updated>2017-03-21T05:12:32Z</updated>
			<id>https://forexsb.com/forum/post/42373/#p42373</id>
		</entry>
</feed>
