Download MetaTrader 5

how to find ArrayMaximum() and Minimum() non-absolute values?

To add comments, please log in or register
Reaper
140
Reaper  

Hello.

 

Someone can help me to solve this "problem".

 

ArrayMinimum() and ArrayMaximum() just return respectively the index of most minimum(littlest) and the most maximum(biggest) value into the Array passed to it.

So it give absolute minumum and maximum, values, of an array.

 

But what if one search for relative min and max? The second minimum, the third etc.?

I mean not the littlest or biggest value, but the second little and second bigger(i.e. if the biggest value is 5, the second bigger is 3 etc..)

 

How to do this with just ArrayMaximum()/Minimum() function, or with just like few line of code, without turning crazy with 50 lines of code?

 

Thanks! 

Documentation on MQL5: Array Functions / ArrayMaximum
  • www.mql5.com
Array Functions / ArrayMaximum - Documentation on MQL5
Simone Ambrogio
465
Simone Ambrogio  
Reaper:

Hello.

 

Someone can help me to solve this "problem".

 

ArrayMinimum() and ArrayMaximum() just return respectively the index of most minimum(littlest) and the most maximum(biggest) value into the Array passed to it.

So it give absolute minumum and maximum, values, of an array.

 

But what if one search for relative min and max? The second minimum, the third etc.?

I mean not the littlest or biggest value, but the second little and second bigger(i.e. if the biggest value is 5, the second bigger is 3 etc..)

 

How to do this with just ArrayMaximum()/Minimum() function, or with just like few line of code, without turning crazy with 50 lines of code?

 

Thanks! 

 

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

Documentation on MQL5: Array Functions / ArraySort
  • www.mql5.com
Array Functions / ArraySort - Documentation on MQL5
To add comments, please log in or register