Discussing the article: "Reimagining Classic Strategies (Part 22): Ensemble Mean Reverting Strategy"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Reimagining Classic Strategies (Part 22): Ensemble Mean Reverting Strategy.
This article will illustrate to the reader how to implement a mean-reverting strategy for the EURUSD pair. The strategy follows contrarian trading rules. Our strategy implements a weekly moving average channel, with one moving average on the high-price feed and the latter on the low-price feed. We enter short positions when the price falls beneath the low moving average and long positions when the price rises above the high moving average. Additionally, we will export daily market data to build a simple ONNX model of the market to provide an additional filter for our entries. This provides the reader with a reproducible template for strategy development and backtesting.
This article illustrates how to implement a mean-reverting trading strategy in MetaTrader 5. The strategy seeks to enter positions when price levels break beyond extreme highs or extreme lows. To implement this strategy, we must first define what constitutes an extreme high or an extreme low.
In this discussion, we apply two moving averages to the weekly time frame. One moving average is applied to the high price feed, while the other is applied to the low price feed. These two moving averages share the same period and, as a result, form a channel on the weekly time frame.
When price levels break beyond this channel, we consider those price movements to generate the entry signals for the trading strategy. If price levels break above the high moving average, the strategy assumes that the market is overbought and therefore enters short positions. Conversely, if price levels break beneath the low moving average, the strategy assumes that the market is oversold and enters long positions.
To reinforce the strategy, we employed a statistical model of the market built using the ONNX Library. This statistical model provided the additional confirmation required before executing our entry signals. We trained our model on historical data ranging from 2011 to 2019. We reserved data from 2020 until 2026 to serve as our test period.
Author: Gamuchirai Zororo Ndawana