← Strategy library

Dual EMA Crossoverwith EMA-200 regime filter

Evidence: ModerateBeginnerTrend Following · Indicator-based

The crossover of the 20 and 50 EMAs gives direction. The 200 EMA is a regime filter — you trade only in the direction the long-term slope agrees with.

The biggest cost in any crossover system is counter-trend whipsaw. The whole job of the 200 EMA filter is to keep you trading only in periods where there is evidence of drift.

Category
Trend Following · Indicator-based
Timeframe
H4 primary · D1 secondary
Suitable pairs
EURUSD · GBPUSD · USDJPY · AUDUSD · USDCAD · XAUUSD
Session
Signal at the bar close · execute in London or New York
Indicators / tools
EMA(20) · EMA(50) · EMA(200) · ATR(14)

Valid setup

S02 · EMA 20/50 CROSS INSIDE AN EMA-200 UP-REGIME — VALID SETUP GBPUSD · H4 · the long EMA grants permission, the cross supplies timing LONG 1.2349 1.2449 1.2548 1.2648 1.2747 1.2847 1.2947 ENTRY = next bar open SL = entry − 1.5×ATR(14) +2R reference 1R +2R 1 2 3 4 5 ① Price reclaims and holds above EMA200 → regime flips to LONG-ONLY ② Pullback respects EMA200 (higher low) ③ EMA20 crosses ABOVE EMA50, on a closed bar ④ Entry next bar open ⑤ Hold until the opposite cross Short signals in this window are IGNORED — they point against the EMA200 regime. 1.2730 1.2661 1.2626 EMA 200 EMA 50 EMA 20 20/50 cross

Exact rules

Entry

  • Regime gate: close above EMA(200) and the EMA(200) sloping up — its value now above its value ten bars ago. That is a long-only window. The reverse for shorts.
  • Trigger: EMA(20) crosses above EMA(50) on a closed bar.
  • Enter at the next bar's open.
  • If the crossover goes against the regime, ignore the signal completely. That is what the filter is for.

Stop loss

  • Entry − 1.5 × ATR(14) for a long.
  • Alternative: 0.5 × ATR beyond the far side of the EMA(50) — use whichever is wider.
  • Risk 0.5%–1% per trade.

Take profit / exit

  • The primary exit is a signal: the opposite EMA(20)/EMA(50) crossover.
  • Secondary: if price closes on the wrong side of the EMA(200), the regime has broken — exit.
  • A fixed target at 2R is optional as a partial. But note that a fixed target lowers this system's expectancy, because the payoff distribution is fat-tailed.

Build Dual EMA Crossover

Reading this page is free and always will be. Taking it is what costs — the complete MQL5 for the rules above, yours to keep, permanently. Five of them cost $10 and they never expire.

More from Foundations

Trading carries risk and most retail accounts lose money. Nothing on this page is financial advice or a recommendation to trade. The chart is an illustration of the rules on constructed candles — it is not a record of a trade and not a backtest.