Skip to content
All library documents

Flexible Moving Average Algorithms for Technical Indicators

Article MQL5 articles

Summary

This article presents a reusable averaging function for MetaTrader indicators and Expert Advisors. Its SmoothXSeries interface selects among nine smoothing methods, including adaptive or specialized algorithms as well as simple, exponential, smoothed, and linear-weighted averages. The author shows how to apply it to a price series to create a configurable moving average, then reuse the same function for double smoothing and for components of a MACD-style indicator.

The proposed workflow is to replace fixed calls to standard indicators with custom indicators whose averaging method can be changed through inputs. This makes it possible to compare smoothing choices within the same system. The article provides implementation examples, but no comparative backtest results or evidence that any particular method improves profitability. It notes that using the approach requires indicator-programming experience and builds on a previous installment that describes the component algorithms.

Key ideas

  • A shared smoothing function can select among nine averaging algorithms.
  • Custom indicators can expose the smoothing method as a configurable input.
  • The same function can smooth prices, smooth an existing average again, or process MACD components.
  • The article gives implementation examples but does not compare trading performance across methods.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.