Serious MQL4 bug

 
Why does the contents of an array have an affect on the processing time of an indicator when iMAOnArray is used on a half initialised array. If iMAOnArray has the number of elements that are initialised passed as a parameter it works correctly but if zero, meaning the whole array is used, then the indicator runs 50 times slower. This means the contents of the array is affecting the execution of iMAOnArray. Why?
 

Please, give more details.

 

Hi Rosh

It's at times like these that I doubt that I saw the problem. I have attempted to make a small piece of code to demonstrate the problem but I can't recreate it. Using indicator line 71 instead of 72 is supposed to show that that the dummy EA would run much slower but it doesn't demonstrate it. However can you explain a couple of things.

1) Why doesn't the code run slower when the whole of the indicator buffer is used by iMAOnArray as opposed to just 10 elements? surely the indicator buffer is 10000 elements or more.

2) Why does the code run much more than 10 slower by setting limit to 10? I thought it would be proportional.

Thanks

Files:
tworm.zip  2 kb
Reason: