Using LSTM to Forecast ADX for Trend-Following Filters
Summary
The article outlines a workflow for using an LSTM regression model to estimate future trend strength and filter trend-following entries. It motivates forecasting ADX rather than relying on its current value, which may rise after much of a move has already happened. Suggested inputs are ADX, RSI, and a candle return, with the target defined as the mean of future ADX observations. The workflow collects hourly data from MetaTrader 5, prepares sequences in Python, trains an LSTM, and integrates the model into an MQL5 expert advisor.
The article describes a planned historical training period and a later out-of-sample period, and refers to statistical backtesting and walk-forward approaches. It gives implementation examples, but the supplied training excerpt is truncated and no numerical performance results are available here. The approach depends on the underlying trend-following strategy having an edge; feature choice, model settings, and the relationship between predicted ADX and trade outcomes require further validation. The article presents the method as an experiment rather than evidence that the model improves returns.
Key ideas
- Forecast future ADX as a proxy for whether trend conditions may persist, instead of entering based only on current ADX.
- Use ADX, RSI, and a stationary price-return feature as candidate inputs to a sequence model.
- Label each sample with an average of subsequent ADX values to represent near-term trend strength.
- Train the LSTM on chronological sequences and evaluate it on later unseen data.
- Model quality alone does not establish a trading edge; the base strategy and filtering effect also need rigorous testing.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.