Discussing the article: "From Static MA to Adaptive Filtering (Part 1): Introducing SAMA with NLMS in MQL5"

 

Check out the new article: From Static MA to Adaptive Filtering (Part 1): Introducing SAMA with NLMS in MQL5.

This article introduces the Self-Adaptive Moving Average (SAMA), an adaptive filter leveraging the Normalized Least Mean Squares (NLMS) algorithm. It explores why fixed-period averages fail, how NLMS adapts bar by bar, and the engineering protections required for production. This conceptual and mathematical foundation prepares you for the MQL5 code implementation in Part 2.

Traders know the pattern: an SMA or EMA can look perfect for a while — until the market regime shifts and the same fixed-period filter either lags badly in impulses or chops accounts in sideways ranges. The issue is not that moving averages are poorly coded, but that their period is static while the market is not. That mismatch forces endless manual retuning: shorten the period and you get noise; lengthen it and you get lag.

This series offers a concrete alternative: a chart-ready Self-Adaptive Moving Average (SAMA) implemented in MQL5, powered by the Normalized Least Mean Squares (NLMS) adaptive-FIR framework. Crucially, this is written with an explicit success criterion: produce a live, non-repainting indicator that adapts to regime changes without per‑regime period tuning, remains stable during price spikes and news, updates weights only on closed bars, and is usable directly on charts, in EAs, and in backtests. Part 1 explains the motivation, the math, and the core NLMS loop. Part 2 builds the full MQL5 indicator; Part 3 benchmarks it against classical filters.

Author: Ushana Kevin Iorkumbul

 

Really enjoyed this first part — the way you frame SAMA as a true adaptive FIR rather than just another MA variant is spot‑on, and the NLMS implementation details are exceptionally clear. I’m especially looking forward to Part 3 where you benchmark SAMA against classical filters.

One thing I hope you might consider including in the comparison: an autocorrelogram‑based period proxy. Since SAMA adapts to the evolving frequency profile of the market, it would be fascinating to see how its behaviour aligns with the dominant lags/periodicities revealed by the autocorrelogram, especially in contrast to fixed‑period SMAs/EMAs. It feels like a natural diagnostic tool for showing where adaptive filtering captures structure that static filters miss.

Either way, great work — excited to read the next parts.