<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Portfolio - change the number of strategies which are trading]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/7698/" />
	<updated>2019-01-19T08:06:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/7698/portfolio-change-the-number-of-strategies-which-are-trading/</id>
		<entry>
			<title type="html"><![CDATA[Re: Portfolio - change the number of strategies which are trading]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/53947/#p53947" />
			<content type="html"><![CDATA[<p>Just checked to change the strategiescount manually. When ea habe signalList stablished with 100 entries. and i change strategiescount to 100 than ea get out critical error in backtest. so this couldnt be work.</p><p>So i think only way to do is really to say on each signalList to add an if statement</p>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2019-01-19T08:06:31Z</updated>
			<id>https://forexsb.com/forum/post/53947/#p53947</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Portfolio - change the number of strategies which are trading]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/53945/#p53945" />
			<content type="html"><![CDATA[<p>Hmm, can you attach the whole MQ4 file? I can then have a look and fix it. There must be some other error that causes the if expression problem, as they can be used fine on the global scope (something with the variables definition most likely).</p>]]></content>
			<author>
				<name><![CDATA[geektrader]]></name>
				<uri>https://forexsb.com/forum/user/1841/</uri>
			</author>
			<updated>2019-01-18T22:32:19Z</updated>
			<id>https://forexsb.com/forum/post/53945/#p53945</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Portfolio - change the number of strategies which are trading]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/53944/#p53944" />
			<content type="html"><![CDATA[<p>i try this now</p><div class="codebox"><pre><code>enum ENUM_STRAT
   {
   Full,
   Half,
   OneFourth   
   };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
   
static input double Entry_Amount      = 0.01; // Entry lots
static input int    Base_Magic_Number = 100;  // Base Magic Number
input ENUM_STRAT           numberstrategies           = Full;                 // Set Number Strategies used
#define TRADE_RETRY_COUNT 4
#define TRADE_RETRY_WAIT  100
#define OP_FLAT           -1

// Session time is set in seconds from 00:00
const int sessionSundayOpen           = 0;     // 00:00
const int sessionSundayClose          = 86400; // 24:00
const int sessionMondayThursdayOpen   = 0;     // 00:00
const int sessionMondayThursdayClose  = 86400; // 24:00
const int sessionFridayOpen           = 0;     // 00:00
const int sessionFridayClose          = 86400; // 24:00
const bool sessionIgnoreSunday        = true;
const bool sessionCloseAtSessionClose = true;
const bool sessionCloseAtFridayClose  = false;

//const int    strategiesCount = 100;
if(numberstrategies==Full)
{
 int    strategiesCount = 100;
}
if(numberstrategies==Half)
{
 int    strategiesCount = 50;
}
if(numberstrategies==OneFourth)
{
 int    strategiesCount = 25;
}
const double sigma           = 0.000001;</code></pre></div><br /><p>GET THIS ERRORS</p><div class="codebox"><pre><code>&#039;if&#039; - expressions are not allowed on a global scope    Portfolio Expert EURUSD H1 (9).mq4    50    1</code></pre></div><div class="codebox"><pre><code>&#039;strategiesCount&#039; - undeclared identifier    Portfolio Expert EURUSD H1 (9).mq4    382    18</code></pre></div><br /><br /><br /><p>TRIED ALSO LIKE THIS</p><div class="codebox"><pre><code>int strategiescount = 100;
//const int    strategiesCount = 100;
if(numberstrategies==Full)
{
     strategiescount = 100;
}
if(numberstrategies==Half)
{
     strategiescount = 50;
}
if(numberstrategies==OneFourth)
{
     strategiescount = 25;
}
int strategiesCount = strategiescount;</code></pre></div><p>AND GET NOW ONLY THIS ERROR</p><div class="codebox"><pre><code>&#039;if&#039; - expressions are not allowed on a global scope    Portfolio Expert EURUSD H1 (9).mq4    50    1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2019-01-18T20:51:22Z</updated>
			<id>https://forexsb.com/forum/post/53944/#p53944</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Portfolio - change the number of strategies which are trading]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/53943/#p53943" />
			<content type="html"><![CDATA[<p>As far as I can see it, you´d just need to change the strategiesCount variable, as this is being used throughout the code to check the entry and exit signals. So instead of:</p><div class="codebox"><pre><code>const int    strategiesCount = 100;</code></pre></div><p>You´d change it to:</p><div class="codebox"><pre><code>input int    strategiesCount = 100;</code></pre></div><p>And then simply change the number of the strategies you want to trade. However, take note that if you change it while there are open trades, systems &gt; the number you´ve entered, will have their trades going unmanaged from there on, as it will also only check the exits for the number you´ve entered there.</p><p>P.S.: You can definitely do if statements on the global scope, I do it all the time. Who says you can´t?</p>]]></content>
			<author>
				<name><![CDATA[geektrader]]></name>
				<uri>https://forexsb.com/forum/user/1841/</uri>
			</author>
			<updated>2019-01-18T20:32:10Z</updated>
			<id>https://forexsb.com/forum/post/53943/#p53943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Portfolio - change the number of strategies which are trading]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/53942/#p53942" />
			<content type="html"><![CDATA[<p>Hi,</p><p>i want to modify an Portfolio ea with 100 strategies.</p><p>Now i have build an enum input.</p><div class="codebox"><pre><code>enum_strategies
{
Full,
Half,
One Fourth
};

and this as input
input ENUM_strategies            numberstrats = Full;                  </code></pre></div><p>Now with this i want to change the number of stratgies which are trading. So if i have 100 stratgies in my portfolio i use &quot;Full&quot; and all strategies work.</p><p>If i decide to change into &quot;Half&quot; than the first 50 stratgies only trade .How can i change it easily.</p><p>I tried to change the </p><div class="codebox"><pre><code>const int    strategiesCount = 100;</code></pre></div><p> but its not allowed to do if statements in the global scope.</p><p>So the only way i know how it is working to put here<br /></p><div class="codebox"><pre><code>   signalList[i++] = GetExitSignal_00();
if(numberstrats==Full)
   signalList[i++] = GetEntrySignal_00();</code></pre></div><p>But when i have 100 strategies and 3 different enumarations its a much to change in code. </p><p>So&nbsp; if someone have a good idea it will be great.</p>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2019-01-18T18:51:51Z</updated>
			<id>https://forexsb.com/forum/post/53942/#p53942</id>
		</entry>
</feed>
