A library of averaging algorithms, the algorithms were described in details in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers". The SmoothAlgorithms.zip file contains the MQL4 version of the library. The EMA.mq5 indicator provides an example of using the averaging algorithms from the library. The indicator code is written in such a way that it makes no difference, for which language you compile the indicator with the appropriate averaging library corresponding to the language and with the appropriate extension of the original indicator file.
Fig1. The EMA indicator in the MetaTrader 5 terminal window
Fig.2. The EMA indicator in the MetaTrader 4 terminal window
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/17472
A simple trend indicator of the oscillator type.mt-R
Libraries for the interaction of МТ4/5 with R