Download MetaTrader 5

Simple Question regarding ArrayMaximum (and ArrayMinimum)

To add comments, please log in or register
gatornuke
353
gatornuke  

I have a question regarding the ArrayMaximum / Minimum functions. The documentation is not clear as to whether or not the arrays are read from right to left or left to right. For instance, say i want to record the maximum of elements 6,7,8 in the following array:

array[10]={0,1,2,3,4,5,6,7,8,9}

Will the following expression return the maximum value of elements 6,7,8, or 4,5,6? I suspect it's the former, but would like to confirm.

max = array[ArrayMaximum(array, 3,6)]
Simon Gniadkowski
Moderator
18018
Simon Gniadkowski  
gatornuke:

I have a question regarding the ArrayMaximum / Minimum functions. The documentation is not clear as to whether or not the arrays are read from right to left or left to right. For instance, say i want to record the maximum of elements 6,7,8 in the following array:

Will the following expression return the maximum value of elements 6,7,8, or 4,5,6? I suspect it's the former, but would like to confirm.

It has to be read left to right, 0 to n, otherwise 0 could not be valid for the start parameter, 0 is the default for the start parameter.
gatornuke
353
gatornuke  
That's what i thought. Thanks.
RaptorUK:
It has to be read left to right, 0 to n, otherwise 0 could not be valid for the start parameter, 0 is the default for the start parameter.

whroeder1
15062
whroeder1  
It is read from [start to start+n-1]. Left and right depend on ArraySetAsSeries
To add comments, please log in or register