Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

GetExtremums - MetaTrader 5 Library | Forex Indicators Download - MT4/MT5 Resources

author EAcpu | 3 reads | 0 comments |

The GetExtremums() function is designed to identify extreme values ​​for a given historical period. The search algorithm is similar to that used in the Fast ZZ indicator and uses only one parameter - the minimum price change - to identify extreme values.

 Integer gets extreme value ( double range, //minimum price change Mql rate &rate[], //array of historical quotes right extreme value&ge[], //return extreme value array integer total = 0 ) //required number of extreme values ​​or all extreme values ​​are zero
parameter:
  • Double range - the minimum price change required to determine extreme values;
  • Mql rate&rate[] - array of quotes;
  • rvalue&ge[] - an array that stores the identified extreme values ​​in consecutive order, with the temporally closest extreme value being stored in the first element (0 index).
  • integer total - The limit of the total number of extreme values ​​to be found. By default all extreme values ​​are searched (total == 0).
Return value:
  • The number of elements in the extremum array.

The following structure is used for the description of extreme values.

 Structure right-hand // extreme value description {
Integer type; //1 - peak value, -1 - trough value date time time;
Double the value ;
};


Example using GetExtremums().


Attachment download

📎 getextremums.mqh (5.22 KB)

Source: MQL5 #1052

Verification code Refresh