MQL4 Reference Constants, Enumerations and Structures Indicator Constants Price Constants

Price Constants

Calculations of technical indicators require price values and/or values of volumes, on which calculations will be performed. There are 7 predefined identifiers from the ENUM_APPLIED_PRICE enumeration, used to specify the desired price base for calculations.

ENUM_APPLIED_PRICE

ID

Value

Description

PRICE_CLOSE

0

Close price

PRICE_OPEN

1

Open price

PRICE_HIGH

2

The maximum price for the period

PRICE_LOW

3

The minimum price for the period

PRICE_MEDIAN

4

Median price, (high + low)/2

PRICE_TYPICAL

5

Typical price, (high + low + close)/3

PRICE_WEIGHTED

6

Weighted close price, (high + low + close + close)/4

The iStochastic() technical Indicator can be calculated in two ways using:

  • either only Close prices;
  • or High and Low prices.

To select a necessary variant for calculation, specify one of the values of the ENUM_STO_PRICE enumeration.

ENUM_STO_PRICE

ID

Description

STO_LOWHIGH

Calculation is based on Low/High prices

STO_CLOSECLOSE

Calculation is based on Close/Close prices