MQL4 Reference Technical Indicators iEnvelopesOnArray

iEnvelopesOnArray

Calculates the Envelopes indicator on data, stored in array, and returns its value.

double  iEnvelopesOnArray(
   double       array[],          // array with data
   int          total,            // number of elemements
   int          ma_period,        // MA averaging period
   int          ma_method,        // MA averaging method
   int          ma_shift,         // MA shift
   double       deviation,        // deviation (in percents)
   int          mode,             // line index
   int          shift             // shift
   );

Parameters

array[]

[in]  Array with data.

total

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

ma_period

[in]  Averaging period for calculation of the main line.

ma_method

[in]  Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.

ma_shift

[in]  MA shift. Indicator line offset relate to the chart by timeframe.

deviation

[in]  Percent deviation from the main line.

mode

[in]  Indicator line index. It can be any of Indicators line identifiers enumeration value (0 - MODE_MAIN, 1 - MODE_UPPER, 2 - MODE_LOWER).

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 Envelopes indicator, calculated on data, stored in array[].

Note

Unlike iEnvelopes(...), the iEnvelopesOnArray() function 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:

  double val=iEnvelopesOnArray(ExtBuffer,10,13,MODE_SMA,0,0.2,MODE_UPPER,0);