<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — MT5 Portfolio - how to change code for opening only BUY or SELL trades]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/9685/" />
	<updated>2024-07-16T18:46:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/9685/mt5-portfolio-how-to-change-code-for-opening-only-buy-or-sell-trades/</id>
		<entry>
			<title type="html"><![CDATA[Re: MT5 Portfolio - how to change code for opening only BUY or SELL trades]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/80609/#p80609" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>=for example when we want to use only buys only sells..there must be an option in EAS to set this on true and it will be added automatically in code..</p></blockquote></div><p>for what I know, at EA level there&#039;s the Long or Short Entry Rule Indicator for opening only BUY or SELL; but you can&#039;t apply it to the entire portfolio. I want the same EA is generated both with BUY and SELLS trades, and eventually apply the BUY/SELL filter at Portfolio level in strong trends only.</p><p>Manually adding the BUY/SELL condition to every EA is a very long process if you have dozens of strategies in the portfolio (it meas doubling the strategies for having the same EA counted twice: one version opens BUY only, the other version opens SELL only).</p>]]></content>
			<author>
				<name><![CDATA[poteree]]></name>
				<uri>https://forexsb.com/forum/user/14942/</uri>
			</author>
			<updated>2024-07-16T18:46:55Z</updated>
			<id>https://forexsb.com/forum/post/80609/#p80609</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: MT5 Portfolio - how to change code for opening only BUY or SELL trades]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/80581/#p80581" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>poteree wrote:</cite><blockquote><p>Many thanks Roughey, it works! As from image attached, the 2 new inputs appear now in the Portfolio Box on MT5.</p><p>I believe you can support Mr Popov in adding new functionalities to the Portfolio :-D another small change (I hope) having a even higher positive impact is this one:<br /><a href="https://forexsb.com/forum/topic/9767/how-to-automatically-stop-eas-with-closed-profit-0-to-open-trades/">https://forexsb.com/forum/topic/9767/ho … en-trades/</a></p></blockquote></div><p>there are some things we can do and add with bool. </p><p>this are small kind of codes i think popov can do it also.. in my opinion it is possible to use such code snippets to add automatically.<br />i dont know how popovs basic mql code can be changed. but for example when we want to use only buys only sells..there must be an option in EAS to set this on true and it will be added automatically in code..</p>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2024-07-15T11:53:26Z</updated>
			<id>https://forexsb.com/forum/post/80581/#p80581</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: MT5 Portfolio - how to change code for opening only BUY or SELL trades]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/80580/#p80580" />
			<content type="html"><![CDATA[<p>Many thanks Roughey, it works! As from image attached, the 2 new inputs appear now in the Portfolio Box on MT5.</p><p>I believe you can support Mr Popov in adding new functionalities to the Portfolio :-D another small change (I hope) having a even higher positive impact is this one:<br /><a href="https://forexsb.com/forum/topic/9767/how-to-automatically-stop-eas-with-closed-profit-0-to-open-trades/">https://forexsb.com/forum/topic/9767/ho … en-trades/</a></p>]]></content>
			<author>
				<name><![CDATA[poteree]]></name>
				<uri>https://forexsb.com/forum/user/14942/</uri>
			</author>
			<updated>2024-07-15T11:45:30Z</updated>
			<id>https://forexsb.com/forum/post/80580/#p80580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: MT5 Portfolio - how to change code for opening only BUY or SELL trades]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/80493/#p80493" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>poteree wrote:</cite><blockquote><p>Good afternoon EA Studio community,</p><p>waiting eventually for having this option inside the Portfolio settings, in the meanwhile does anyone Know how to change the MT5 Portoflio code downloaded by Portoflio Summary in Ea Studio, in order to let only BUY trades or SELL trades to be opened by all the strategies inside the portfolio?</p><p>Thanks a lot for the tip!</p></blockquote></div><br /><p>put in this inputs</p><div class="codebox"><pre><code>input bool                 OnlyBuys                   = false;                 //Allow only Buy orders
input bool                 OnlySells                  = false;                 //Allow only Sell orders</code></pre></div><p>and in</p><div class="codebox"><pre><code>void ManageSignal(Signal &amp;signal)</code></pre></div><p>add this lines at the end</p><div class="codebox"><pre><code>         if(OnlyBuys &amp;&amp; signal.Direction == ORDER_DIRECTION_SELL)
           {          
            return;
           }
         if(OnlySells &amp;&amp; signal.Direction == ORDER_DIRECTION_BUY)
           {          
            return;
           }                       
//---        
      if (signal.Direction == ORDER_DIRECTION_BUY || signal.Direction == ORDER_DIRECTION_SELL)
         OpenPosition(signal);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2024-07-06T07:23:53Z</updated>
			<id>https://forexsb.com/forum/post/80493/#p80493</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[MT5 Portfolio - how to change code for opening only BUY or SELL trades]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/78957/#p78957" />
			<content type="html"><![CDATA[<p>Good afternoon EA Studio community,</p><p>waiting eventually for having this option inside the Portfolio settings, in the meanwhile does anyone Know how to change the MT5 Portoflio code downloaded by Portoflio Summary in Ea Studio, in order to let only BUY trades or SELL trades to be opened by all the strategies inside the portfolio?</p><p>Thanks a lot for the tip!</p>]]></content>
			<author>
				<name><![CDATA[poteree]]></name>
				<uri>https://forexsb.com/forum/user/14942/</uri>
			</author>
			<updated>2024-03-05T12:26:32Z</updated>
			<id>https://forexsb.com/forum/post/78957/#p78957</id>
		</entry>
</feed>
