MQL4 iMomentum Indicator

Overview

Calculates the Momentum indicator and returns its value.

Function Signature

double iMomentum(
  string      symbol,       // symbol
  int         timeframe,    // timeframe
  int         period,       // averaging period
  int         applied_price, // applied price
  int         shift         // shift
);

Parameters

  • **symbol**: Symbol name for calculation. NULL for current symbol.
  • **timeframe**: Timeframe. Any ENUM_TIMEFRAMES value. 0 for current chart timeframe.
  • **period**: Averaging period (number of bars) for price change calculation.
  • **applied_price**: Applied price. Any ENUM_APPLIED_PRICE value.
  • **shift**: Index of the indicator buffer value (shift relative to the current bar).
  • Return Value

    Numerical value of the Momentum indicator.

    Example

    if(iMomentum(NULL,0,12,PRICE_CLOSE,0)>iMomentum(NULL,0,20,PRICE_CLOSE,0)) return(0);
    

    Related Functions

  • iBWMFI
  • iMomentumOnArray