Search Max and Min values ofan indicator

 

Hello,

I would like to know how is it possible to search the Max or the Min value of an indicator (the MACD for example) for a limited period and save this value into an array. 

Thank you 

 
Antoine:

Hello,

I would like to know how is it possible to search the Max or the Min value of an indicator (the MACD for example) for a limited period and save this value into an array. 

Thank you 

MaxValue

Returns the value and index of maximal element of the specified buffer in a specified range.

double  MaxValue(
   int   buffer_num,     // buffer number
   int   start,          // starting index
   int   count,          // number of elements to proceed
   int&  index           // reference
   ) const
 

Parameters

buffer_num

[in]  Buffer number to search the value in.

start

[in]  Starting index.

count

[in]  Number of elements to proceed.

index

[out]  Reference to the variable of int type for the maximal element index.

Returned value

The value of the maximal element of the specified buffer in a specified range.

Note

The index of maximal buffer element is stored into the variable index, passed by reference.
MinValue

Returns the value and index of minimal element of the specified buffer in a specified range.

double  MinValue(
   int   buffer_num,     // buffer number
   int   start,          // starting index
   int   count,          // number of elements to proceed
   int&  index           // reference
   ) const
 

Parameters

buffer_num

[in]  Buffer number to search the value in.

start

[in]  Starting index.

count

[in]  Number of elements to proceed.

index

[out]  Reference to the variable of int type for the minimal element index.

Returned value

The value of the minimal element of the specified buffer in a specified range.

Note

The index of minimal buffer element is stored into the variable index, passed by reference.
Both methods are members of CIndicator class provided with MT5 terminal.