Using Jurik Moving Average Smoothing in MQL4 Indicators
Summary
This article describes how to apply a Jurik Moving Average (JMA) routine as a replacement for conventional averaging in MQL4 indicators and Expert Advisors. Its central contribution is a reusable series function, with companion routines for resizing internal buffers, checking parameter ranges, and recording errors. The article also gives an example of applying JMA twice to a price series and explains how to smooth the output of another indicator.
Correct use depends on managing the function’s state and call sequence. Each call needs a unique identifier, internal buffers must be sized at initialization, and bars must be processed in the required order. The function has constraints on its limit and bar parameters; early or out-of-range calculations can return zero, so those values may affect downstream indicator formulas. The implementation is intended for time-series arrays from the current chart, and the article warns that applying it to data from other charts produces incorrect calculations. It points to a collection of example indicators, but presents no comparative performance evidence or trading results.
Key ideas
- JMA can replace conventional averaging in indicator and Expert Advisor calculations.
- Each JMA call needs a unique identifier and correctly sized internal buffers.
- The bar and limit inputs have strict constraints that affect valid calculations.
- Returned zero values during initialization or beyond the configured range can affect later formulas.
- The described function is designed for the current chart’s time series, not series from other charts.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.