Discussing the article: "Self Optimizing Expert Advisors in MQL5 (Part 9): Double Moving Average Crossover"

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: Self Optimizing Expert Advisors in MQL5 (Part 9): Double Moving Average Crossover.
This article outlines the design of a double moving average crossover strategy that uses signals from a higher timeframe (D1) to guide entries on a lower timeframe (M15), with stop-loss levels calculated from an intermediate risk timeframe (H4). It introduces system constants, custom enumerations, and logic for trend-following and mean-reverting modes, while emphasizing modularity and future optimization using a genetic algorithm. The approach allows for flexible entry and exit conditions, aiming to reduce signal lag and improve trade timing by aligning lower-timeframe entries with higher-timeframe trends.
Our initial attempts involved using statistical modeling tools to forecast moving average crossovers in advance. We made progress in this direction and found that, under the right market conditions, forecasting moving average crossovers can be more accurate than forecasting price directly. From there, we discovered yet another method to further reduce lag. This approach involves fixing the periods of the two moving averages so they share a common value, and instead generating crossovers by applying one moving average to the opening price and the other to the closing price. This alternative system proved effective, allowing us to reduce lag further without relying on advanced modeling tools—just by using the same period and varying the applied price of the two indicators.
In this discussion, we explore yet another unique approach that we have not considered before. As with most problems in life and mathematics, there is more than one way to tackle an issue, and each solution comes with its own set of advantages and disadvantages. By weighing these alternatives, we aim to understand how much control we can exert over lag in the system.
Here, we will attempt what I refer to as a double moving average crossover strategy. As shown in Figure 1, the classical moving average crossover strategy is typically used on a single timeframe with two moving averages of different periods. Unlike our previous discussion—where both moving averages shared a fixed period—this time we revert slightly to the classical approach, allowing the two indicators to use different periods.
The problem with this original form is that confirmation for entry signals often arrives late—after the move has already begun—leading to delayed entries or missed opportunities.
Author: Gamuchirai Zororo Ndawana