Hi, here's a code :
for(int i=0; i<N; i++) LastHeight=LastHeight+ArrayHigh[i]-ArrayLow[i];
//--- calculating the average size of the last N bars
With the error I running a test :
2014.10.29 14:08:54 MQL5 Cloud Europe genetic pass (0, 275) tested with error "critical runtime error 502 in OnTick function (array out of range, line 721, col 58)" in 16 ms (PR 177)
Any help would be very appreciate !
Try to use something like this:
(if you need at least "N" bars then you should skip these results)
for(int i=0; i<limit; i++)
Great ! thanks Lost ! I don't need to do it also with arraylow, supposing it should be the same thing ... right ?
Yes, it should be the same but you can do the this: