Download MetaTrader 5

Build 294 problem ?

To add comments, please log in or register
tektronic
137
tektronic  

When testing an ea, the last build 294 says:

2010.07.21 12:13:54 Core 1 CLeadOsc::Create(): ArraySetAsSeries error: 0
2010.07.21 12:13:54 Core 1 Tester stopped because OnInit failed

The code used which makes this stop in tester is this:

   if(!ArraySetAsSeries(iTmpArr,true))
   {
      Print("CLeadOsc::Create(): ArraySetAsSeries error: "+string(GetLastError()));
      return (false);
   } 

 

iTmpArr is a double array, legally stored as class member. 

My big problem is that in prev build 292 I had no such problem; the code above did not produce error and the tester worked ok; now it stops.

Something changed in handling arrays as series ? Thank you

tek 

Alexey Da
Moderator
6648
Alexey Da  

Is it static or dynamic array (https://www.mql5.com/en/docs/array/arraysetasseries)?

If it is dynamic array could you provide source code? 

Documentation on MQL5: Array Functions / ArraySetAsSeries
  • www.mql5.com
Array Functions / ArraySetAsSeries - Documentation on MQL5
tektronic
137
tektronic  

you have the source in the code sent you privately some days ago

it worked ok in 292 

Alexey Da
Moderator
6648
Alexey Da  
tektronic:

you have the source in the code sent you privately some days ago

it worked ok in 292 

Sorry...

I'll check it now. 

Alexey Da
Moderator
6648
Alexey Da  

Look at this.

Create method of  CLeadOsc contains:

if(!ArraySetAsSeries(iTmpArr,true))
   {
      Print("CLeadOsc::Create(): ArraySetAsSeries error: "+string(GetLastError()));
      return (false);
   }

 In line 204 you have declared array iTmpArray as:

double iTmpArr[1];   

So you have static array.

 https://www.mql5.com/en/docs/array/arraysetasseries

Note

The AS_SERIES flag can't be set for multi-dimensional arrays or static arrays (arrays, whose size in square brackets is preset already on the compilation stage). Indexing in timeseries differs from a common array in that the elements of timeseries are indexed from the end toeards the beginning (from the newest to oldest data).

 

 You said that it had worked fine in 292 build. It was a bug, which was been fixed.

Documentation on MQL5: Array Functions / ArraySetAsSeries
  • www.mql5.com
Array Functions / ArraySetAsSeries - Documentation on MQL5
tektronic
137
tektronic  
alexvd:

Look at this.

Create method of  CLeadOsc contains:

 In line 204 you have declared array iTmpArray as:

So you have static array.

 https://www.mql5.com/en/docs/array/arraysetasseries

 

 You said that it had worked fine in 292 build. It was a bug, which was been fixed.

ok, thank you
To add comments, please log in or register