Forex Mean Reversion EA
- Experts
-
Abdullah Al-murad
I build Expert Advisors and utilities for MetaTrader 5, mainly for gold (XAUUSD), forex and crypto.
How I build my products:
- Every robot sends each order with a stop loss. No martingale, no grid averaging, no hidden rules.
- Signals are calculated on closed bars, so they are not redrawn. - 버전: 1.0
- 활성화: 5
Forex Mean Reversion EA trades the statistical tendency of currency pairs to return to their recent average after extreme deviations. The strategy is based on a Z-score filter: when the closing price moves more than 2.5 standard deviations away from its 50-bar rolling mean on the H4 chart, the EA enters against the extreme move and targets a return toward the mean.
HOW THE SIGNAL WORKS
The EA computes, at the close of each H4 bar:
- Rolling mean of the last 50 close prices
- Rolling standard deviation over the same 50 bars
- Z-score = (Close − Mean) / StdDev
A BUY signal fires when Z-score drops below −2.5 (price too low).
A SELL signal fires when Z-score rises above +2.5 (price too high).
EXIT RULES
- Initial stop-loss: 3 × ATR(14) from the entry price
- Take-profit: 1.5 × ATR(14) toward the mean
- Opposite signal also closes the position early
WALK-FORWARD TESTING (8 major pairs, H4, 2021–2026)
The strategy parameters were chosen on the first two-thirds of historical data only. Results on the unseen final one-third:
- Profit factor (unseen): 1.17
- % of pairs with positive result: 100%
- Profit factor including realistic swap costs: 1.05
Past performance does not guarantee future results. These figures are from a historical simulation, not live trading.
RISK MANAGEMENT
- Fixed lot (default 0.01) or risk % of account balance per trade
- Maximum loss cap: limits the lot size so no single trade exceeds a set % of equity
- Margin check: never opens if the required margin exceeds 50% of free margin
- Spread filter: skips entry when the current spread is too wide (configurable)
INPUT PARAMETERS
Signal
- Timeframe: H4 (default)
- Rolling window: 50 bars
- Z-score threshold: 2.5 σ
- ATR period: 14
Exit
- Stop loss: 3.0 × ATR
- Take-profit: 1.5 × ATR
- Max spread: 0.5 × ATR
Risk
- Fixed lot: 0.01
- Risk % of balance: 0.0 (disabled; set > 0 to use)
- Max loss per trade: 10% of equity
- Magic number: 7731000
USAGE
Attach one EA instance to each H4 chart of a major forex pair (EURUSD, GBPUSD, AUDUSD, USDCAD, EURGBP, USDJPY, NZDUSD, USDCHF, etc.). The EA manages its own positions independently on each symbol using the magic number. No other settings are required beyond adjusting the lot size or risk percent to match your account.
IMPORTANT DISCLAIMER
This EA does not guarantee profits. All trading involves risk. Test the EA on a demo account before using it on a live account. The developer is not responsible for trading losses.
