Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 4 Libraries | BB MACD funcs

MetaTrader Experts, Indicators, Scripts and Libraries

In this library there are 2 functions iBandsfunc and iMACDfunc, which extend calculating capabilities of the appropriate functions, e.g. for expert advisers.

The standard function iBands is calculated by using the deviation only as an integer value and on the basis of a simple moving average (SMA). In iBandsfunc it is possible to use deviation as a double value and other moving averages.

The standard function iMACD is calculated by formulas:

MACD = EMA(CLOSE, 12) - EMA(CLOSE, 26)

SIGNAL = SMA(MACD, 9),

where MACD is calculated on the basis only of the exponential moving average (EMA), and the signal line - a simple moving average (SMA). In iMACDfunc it is possible to choose a moving average for main (MACD) and signal line.

Examples of the use these functions can be found in the attached file.

10804

Best MetaTrader Indicators + Profitable Expert Advisors