A story about how switching the moving average line from an "entry" to a "postpone filter" created a winning EA—the correct way to use MA, viewed with real data
In the last time, starting from the 50/200 EMA golden cross and sweeping major time-frame pairs comprehensively, I wrote results showing that the positive territory was zero.The bullish zone was zeroas a verification result.
So should I discard moving averages altogether? My answer was different.
Stop using them for entriesand reposition them as a “wait-and-see filter”—the moment you shifted them, the previously submerged verification framework surfaced into positive territory one after another.
In reality, the core of the EA I am currently monitoring live, “GoldBreakEA_v1,” isa “wait-and-see gate” that fires only when both H1 and H4 EMA40 align in the same direction.
It times the M5 breakout, but if the EMA40 on the top two timeframes do not agree in direction, even if a breakout occurs, I wait on all of them.
Without this wait-and-see gate, the EA itself does not function.
Sorry for the interruption,I am Lulu.fx. I am a current discretionary trader centered on GOLD (XAUUSD), and I am now challenging a prop firm (Company A).
This article will describe using MA as a wait-and-see filter in live-EA monitoring, together with actual verification data.
In this article,1) why MA loses when used for “entries” but wins when used as a “filter,” 2) actual measured data for the core gate of live-EA “H1+H4 EMA40 agreement,” 3) a case where expectation value increased tenfold with CCI+EMA200 trend-following only, 4) how to use EMA slope as a wait-and-see condition, 5) three design templates of MA wait-and-see filter for intermediate traders, together with actual validation results.
? Table of contents
▼ Free release
- Why MA loses on entries but wins as a filter
- Actual measured data for the core gate of live-EA “H1+H4 EMA40 agreement”
▼ Read more and published
Why MA loses on entries but wins as a filter
As shown in the previous article, the “MA cross” entry strategies, including the textbook 50/200 EMA golden cross, produced zero in the EURUSD H1 six-year test in terms of the periods that entered the positive territory.The periods entering the positive territory were zero.
I have over 50,000 configurations of backtest environments where I wrote my own EA in MQL4 for more than a year, but the strategy with MA as the primary entry has been a complete failure.
Two reasons why MA loses at entries
- Lag: MA is an average of the past N bars; crosses and slope changes are always confirmed after the fact. At the entry point, the trend has already progressed, leaving little room for upside.
- High visibility: Traders and EAs around the world see the same signals. If orders in the same direction pile up at the same time, that order becomes predictable liquidity for the counterparty and gets used.
Why using it as a filter changes the scenario
On the other hand, if you remove MA from entries and use it as a filter with the meaning of “do not go,”the situation changes dramatically for three reasons:
- Other edges (breakouts/oscillations/price structure) carry timing: MA is freed from timing judgment, and you only need to answer whether the big picture favors you.
- The high visibility becomes a weapon: The up/down of EMA200 and the slope direction of EMA40, visible to everyone, can be used as a consensus point for the big picture. Use where the world’s eyes are focusing to confirm direction.
- Reducing firing counts minimizes cost disadvantage: A wait rate of 60–95% is not uncommon. Reducing the number of trades to 1/2 to 1/20 reduces accumulated spread losses accordingly.
In short,MA only functions when you are not trading yourself and tell other pieces not to go—that is the conclusion visible from the actual data so far.
Actual data for the core gate of live-EA “H1+H4 EMA40 agreement”
The EA I am currently forward testing, “GoldBreakEA_v1,” times the M5 breakout, but just before that I have laid a wait-and-see gate that says“both H1 EMA40 and H4 EMA40 point in the same direction”.
If they do not align, even if a breakout occurs on M5, everything is waited. Removing this gate makes the EA fail to function.
Gate logic specifications
- Indicated MA: EMA period 40 (both H1 and H4)
- Gate condition: “Price > EMA40 and EMA40 slopes upward” both align on H1 and H4 → Long fires, reverse side all skipped
- Slope determination: numericalize up/down direction by the last five EMA differences
- Entry timing: judged by M5 breakout logic (separate logic)
Comparison of with and without gate (GOLD, 6 years)
Using the same M5 breakout logic, we compare six years of data with and without the H1+H4 EMA40 agreement gate.
- No gate (simple M5 breakout only): negative expectancy, mo/DD never reaches the positive zone, does not constitute an EA (through 128 configurations, zero passed)
- + H1+H4 EMA40 agreement gate: expectancy+0.136〜+0.149R, mo/DD0.088〜0.097, 5 of 6 years positive
- + add daily volatility gate (dayvol>=0.8): expectancy+0.137〜+0.170R, mo/DD0.116〜0.123, 5–6 of 6 years positive
Simply taking a breakout on M5, all 128 configurations were negative, but as soon as you require the EMA40 agreement on the top two timeframes, it rises into positive territory.
Moreover, firing count is reduced by about 60%, and yet the expectancy improves. This is a typical demonstration of how the “MA as a wait-and-see filter” works.
Notes to avoid judging by numbers alone
The numbers above come from Python validation.
Forward testing on real hardware (Forex Tester/MT4) may further reduce expectancy due to spreads and slippage.
In fact, GoldBreakEA_v1’s forward test actual match shows expectancy down to +0.128R, but it remains six years all positive, maintaining mo/DD 0.078.
The structural effectiveness of the filter does not change.
This is all free content up to here.
From here on,I will write about a case where expectancy with CCI+EMA200 trend-following only increased tenfold, how to use EMA slope as a wait-and-see condition, three common patterns where the wait-and-see filter works, and three intermediate designer templates for MA wait-and-see filter, together with actual validation data.
This is content for those who want to know how to place MA in their own EA at the implementation level.
From here (Read more) to be published:
- Real data (USDJPY H1) where expectancy increased tenfold with CCI+EMA200 trend-following only
- An example of using EMA slope as a wait-and-see condition (EURUSD 4H DeMarker)
- Three common patterns where the wait-and-see filter works(top-two TF consensus / EMA200 trend-following side / slope threshold cut)
- Three intermediate design templates(specifications that can be dropped directly into EA code)
- MA filterthat does not work for certain stocks and timeframesand how to distinguish them (EURUSD-specific cautions)