MQL4 Reference Technical Indicators iRSIOnArray

MQL4 Help as One File:

iRSIOnArray

Calculates the Relative Strength Index indicator on data, stored in array, and returns its value.

double  iRSIOnArray(
   double       array[],          // array with data
   int          total,            // number of elements
   int          period,           // averaging period
   int          shift             // shift
   );

Parameters

array[]

[in]  Array with data.

total

[in]  The number of items to be counted. 0 means the whole array.

period

[in]  Averaging period for calculation.

shift

[in]  Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

Returned value

Numerical value of the Relative Strength Index indicator, calculated on data, stored in array[].

Note

Unlike iRSI(...), the iRSIOnArray() does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries() function.

Example:

  if(iRSIOnArray(ExtBuffer,1000,14,0)>iRSI(NULL,0,14,PRICE_CLOSE,1)) return(0);