Skip to content
Technical Indicators

Technical Indicators

Technical Indicator Functions

All functions like iMA, iAC, iMACD, iIchimoku etc. create a copy of the corresponding technical indicator in the global cache of the client terminal. If a copy of the indicator with such parameters already exists, the new copy is not created, and the counter of references to the existing copy increases.

These functions return the handle of the appropriate copy of the indicator. Further, using this handle, you can receive data calculated by the corresponding indicator. The corresponding buffer data (technical indicators contain calculated data in their internal buffers, which can vary from 1 to 5, depending on the indicator) can be copied to a mql5-program using the CopyBuffer() function.

You can’t refer to the indicator data right after it has been created, because calculation of indicator values requires some time, so it’s better to create indicator handles in OnInit(). Function iCustom() creates the corresponding custom indicator, and returns its handle in case it is successfully create. Custom indicators can contain up to 512 indicator buffers, the contents of which can also be obtained by the CopyBuffer() function, using the obtained handle.

There is a universal method for creating any technical indicator using the IndicatorCreate() function. This function accepts the following data as input parameters:

  • symbol name;
  • timeframe;
  • type of the indicator to create;
  • number of input parameters of the indicator;
  • an array of MqlParam type containing all the necessary input parameters.

The computer memory can be freed from an indicator that is no more utilized, using the IndicatorRelease() function, to which the indicator handle is passed.

Note. Repeated call of the indicator function with the same parameters within one mql5-program does not lead to a multiple increase of the reference counter; the counter will be increased only once by 1. However, it’s recommended to get the indicators handles in function OnInit() or in the class constructor, and further use these handles in other functions. The reference counter decreases when a mql5-program is deinitialized.

All indicator functions have at least 2 parameters - symbol and period. The NULL value of the symbol means the current symbol, the 0 value of the period means the current timeframe.

FunctionReturns the handle of the indicator:
iACAccelerator Oscillator
iADAccumulation/Distribution
iADXAverage Directional Index
iADXWilderAverage Directional Index by Welles Wilder
iAlligatorAlligator
iAMAAdaptive Moving Average
iAOAwesome Oscillator
iATRAverage True Range
iBearsPowerBears Power
iBandsBollinger Bands®
iBullsPowerBulls Power
iCCICommodity Channel Index
iChaikinChaikin Oscillator
iCustomCustom indicator
iDEMADouble Exponential Moving Average
iDeMarkerDeMarker
iEnvelopesEnvelopes
iForceForce Index
iFractalsFractals
iFrAMAFractal Adaptive Moving Average
iGatorGator Oscillator
iIchimokuIchimoku Kinko Hyo
iBWMFIMarket Facilitation Index by Bill Williams
iMomentumMomentum
iMFIMoney Flow Index
iMAMoving Average
iOsMAMoving Average of Oscillator (MACD histogram)
iMACDMoving Averages Convergence-Divergence
iOBVOn Balance Volume
iSARParabolic Stop And Reverse System
iRSIRelative Strength Index
iRVIRelative Vigor Index
iStdDevStandard Deviation
iStochasticStochastic Oscillator
iTEMATriple Exponential Moving Average
iTriXTriple Exponential Moving Averages Oscillator
iWPRWilliams’ Percent Range
iVIDyAVariable Index Dynamic Average
iVolumesVolumes
Last updated on