Skip to content
All library documents

Implementing the FATL Digital Filter as an MQL5 Indicator

Article MQL5 articles

Summary

The article uses a simple moving average indicator as a template for building an MQL5 digital filter. It first explains how to inspect compiler errors, fix the earliest reported issue, and distinguish syntax errors from logical mistakes. It then introduces a finite weighted sum of closing prices: each bar is multiplied by a filter-specific coefficient, and the products are added across a fixed period. The example is the FATL filter, for which the article supplies a coefficient series and shows how to adapt the indexing from MQL4 conventions to MQL5 indicator arrays.

The implementation outline covers indicator buffers, initialization, the calculation loop, handling the number of available bars, and recalculating from the previously processed bar. The discussion is primarily an instructional coding example, not an evaluation of trading performance. It uses ready-made coefficients and explicitly leaves the algorithms for deriving those coefficients outside its scope, so it does not establish that the filter predicts prices or improves a trading strategy.

Key ideas

  • A digital filter computes a weighted sum of price observations over a fixed number of bars.
  • The FATL example uses a predefined coefficient table rather than deriving filter weights within the article.
  • MQL5 indicator indexing and price-array handling differ from the MQL4 form shown as a reference.
  • A calculation loop can reuse prior progress by starting from the previous calculated bar.
  • Compiler checks can locate language errors but do not reliably reveal faulty program logic or prove trading value.

Tags

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