<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — "Array out of range"]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/6421/" />
	<updated>2019-11-18T06:41:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/6421/array-out-of-range/</id>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/57972/#p57972" />
			<content type="html"><![CDATA[<p>I am having this exact same problem. I too am getting the &quot;array out of range&quot; error. Similar to the OP, the offending line of code is... </p><div class="quotebox"><blockquote><p>indCompLong.Value[bar]=0;</p></blockquote></div><p>Here is the generated code around this.</p><div class="codebox"><pre><code>void Indicator::OscillatorLogic(int firstBar,int previous,const double &amp;adIndValue[],double levelLong,
                                double levelShort,IndicatorComp &amp;indCompLong,IndicatorComp &amp;indCompShort,
                                IndicatorLogic indLogic)
  {
   double sigma=Sigma();
   firstBar=MathMax(firstBar,2);

   for(int bar=0; bar&lt;firstBar; bar++)
     {
      indCompLong.Value[bar]=0;
      indCompShort.Value[bar]=0;
     }

   switch(indLogic)
     {
      // etc.
     }
   }</code></pre></div><p>Is this a bug, or is this something I can fix?</p>]]></content>
			<author>
				<name><![CDATA[sidmcfarland]]></name>
				<uri>https://forexsb.com/forum/user/11736/</uri>
			</author>
			<updated>2019-11-18T06:41:23Z</updated>
			<id>https://forexsb.com/forum/post/57972/#p57972</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/47224/#p47224" />
			<content type="html"><![CDATA[<p>Yes, everything works well, no errors.</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2017-10-23T09:49:19Z</updated>
			<id>https://forexsb.com/forum/post/47224/#p47224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/47208/#p47208" />
			<content type="html"><![CDATA[<p>Thank you very much footon for your quick reply.<br />Can you load the Strategy in open market now?<br />Can you or somebody rebuild mql4 and mql5 files for me? Because my license expired some days before update.<br />Very grateful if you can check and rebuild.</p><p>Regards,<br />Samuel.</p>]]></content>
			<author>
				<name><![CDATA[srsantana86]]></name>
				<uri>https://forexsb.com/forum/user/10117/</uri>
			</author>
			<updated>2017-10-22T23:43:23Z</updated>
			<id>https://forexsb.com/forum/post/47208/#p47208</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/47199/#p47199" />
			<content type="html"><![CDATA[<p>Samuel, update your FSB to 3.8.4, everything works fine on my end. I&#039;ll check it when market opens later as well.</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2017-10-22T12:40:29Z</updated>
			<id>https://forexsb.com/forum/post/47199/#p47199</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/47192/#p47192" />
			<content type="html"><![CDATA[<p>Hello Popov and Team! <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />Same error when trying to load the EA into the trade demo account.<br />Image 1.<br />We have a similar problem in the following strategy (FSB 3.8.2.0, version 46.0 code):<br />In Zip file are all files (images, xml, mql4, ex4, and log).<br />I checked the lines code cited by Popov and were already correct (lines 2538, 2973, 3239, 3574).<br />I also loaded a good amount of bars in the graph to force the history (as Image 2).<br />I believe there is something else causing the same error.<br />Very grateful if you can check.</p><p>The other EAs are working correctly, even loading a minimum amount of pre-bars between 100 and 200.<br />Thanks in advance for the great tools!</p><p>Regards,<br />Samuel.</p>]]></content>
			<author>
				<name><![CDATA[srsantana86]]></name>
				<uri>https://forexsb.com/forum/user/10117/</uri>
			</author>
			<updated>2017-10-22T06:29:44Z</updated>
			<id>https://forexsb.com/forum/post/47192/#p47192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/40418/#p40418" />
			<content type="html"><![CDATA[<p>Thank you very much Popov.</p>]]></content>
			<author>
				<name><![CDATA[Hannes]]></name>
				<uri>https://forexsb.com/forum/user/9312/</uri>
			</author>
			<updated>2016-12-19T19:11:43Z</updated>
			<id>https://forexsb.com/forum/post/40418/#p40418</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/40407/#p40407" />
			<content type="html"><![CDATA[<p>Thank you for the report.</p><p>This bug is fixed in FSB Pro v 3.8.1 with EA Code v41.</p><p>Please update FSB Pro (you can download the installer and run over your previous installation) and re-export the EA.</p><p>The core of the problem is wrong firstBar calculation in the &quot;Average True Range&quot; indicator.</p><p>You can also fix the bug manually in your EA:</p><p>Change line 2746 from</p><div class="codebox"><pre><code>   int firstBar=period+period+2;</code></pre></div><p> </p><p>to</p><div class="codebox"><pre><code>   int firstBar=period+previous+2;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2016-12-19T07:49:24Z</updated>
			<id>https://forexsb.com/forum/post/40407/#p40407</id>
		</entry>
		<entry>
			<title type="html"><![CDATA["Array out of range"]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/40400/#p40400" />
			<content type="html"><![CDATA[<p>As soon as I attach the following EA to a chart, it removes it instantaneously. </p><p>Screenshot: <a href="http://imgur.com/a/QFjj1">http://imgur.com/a/QFjj1</a></p><p>The log file says the following:</p><div class="quotebox"><blockquote><p>0&nbsp; &nbsp; 00:47:00.586&nbsp; &nbsp; MaxMillion USDJPY USDJPY,H1: MaxMillion USDJPY loaded.<br />0&nbsp; &nbsp; 00:47:00.598&nbsp; &nbsp; MaxMillion USDJPY USDJPY,H1: Loading data: USDJPY,H1, Minumum bars: 202...<br />1&nbsp; &nbsp; 00:47:00.599&nbsp; &nbsp; MaxMillion USDJPY USDJPY,H1: array out of range in &#039;MaxMillion USDJPY.mq4&#039; (1672,22)<br />3&nbsp; &nbsp; 00:47:00.599&nbsp; &nbsp; MaxMillion USDJPY USDJPY,H1: not initialized<br />0&nbsp; &nbsp; 00:47:00.599&nbsp; &nbsp; MaxMillion USDJPY USDJPY,H1: uninit reason 8<br />0&nbsp; &nbsp; 00:47:00.603&nbsp; &nbsp; Expert MaxMillion USDJPY USDJPY,H1: removed<br />0&nbsp; &nbsp; 00:48:34.270&nbsp; &nbsp; Expert MaxMillion USDJPY USDJPY,H1: loaded successfully</p></blockquote></div><p>The following line causes the Exception (left loop in just for context):<br /></p><div class="codebox"><pre><code>for (int bar = 0; bar &lt; firstBar; bar++)
        indComp.Value[bar] = 0; //this one</code></pre></div><p>Could anyone help me? It would be quite the pain to look into it myself, as I have no idea how FSB structures its EAs code wise.</p>]]></content>
			<author>
				<name><![CDATA[Hannes]]></name>
				<uri>https://forexsb.com/forum/user/9312/</uri>
			</author>
			<updated>2016-12-19T03:17:16Z</updated>
			<id>https://forexsb.com/forum/post/40400/#p40400</id>
		</entry>
</feed>
