L1 Trend Filtering for Piecewise-Linear Trends and Trading Signals
Summary
The article explains L1 trend filtering as a way to estimate a piecewise-linear trend from noisy price data. It contrasts the method with the Hodrick–Prescott filter: penalizing the absolute second differences encourages many of them to become zero, leaving linear segments separated by detected slope changes. A regularization parameter controls the number of breakpoints, and the article describes normalizing it as a fraction of the data-dependent maximum value, λmax.
MQL5 implementations calculate λmax and the filtered series, and the article describes indicators for trend slope and direction, residual volatility, and volatility regimes. It also reports applying the filter to moving-average, MACD, ADX, and EMA strategies, with examples involving simulated random walks and S&P 500 data. The available text lists these experiments but does not include their detailed performance results. Suggested parameter ranges are presented as practical starting points, not universal settings; the filter’s usefulness depends on the series, timeframe, and strategy being examined.
Key ideas
- L1 penalization of second differences produces piecewise-linear trends with sparse slope changes.
- The regularization parameter controls trend complexity, from a close fit to a single linear segment.
- Expressing the parameter relative to λmax helps compare settings across series with different scales.
- The article describes trend and volatility indicators derived from the filtered series.
- It evaluates filtering signals from several indicator strategies, but the provided text omits detailed results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.