MathMax from array

 

I have an array which gathers the value of the RSI perfectly. How is the best way to pick the highest value from the past X candlesticks?

   //---------------------RSI--------------------- 

   string signal = "";                                                            // Create a string for the signal
   double myRSIArray[];                                                           // Create an array for the price data
   ArraySetAsSeries(myRSIArray, true);                                            // Sort the price array from the current candle downwards
   int myRSIProperties = iRSI(_Symbol, _Period, 14, PRICE_CLOSE);                 // Define the properties for the RSI
   CopyBuffer(myRSIProperties, 0, 1, 10, myRSIArray);                             // Defined EA, from most recent complete candle, 10 values saved
   double myRSIValue = NormalizeDouble(myRSIArray[0], 2);                         // Calculate CURRENT RSI value, normalized
   
 
Documentation on MQL5: Array Functions / ArrayMaximum
Documentation on MQL5: Array Functions / ArrayMaximum
  • www.mql5.com
ArrayMaximum - Array Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5