2 Free Gold MT5 Expert Advisors – RSI Pair Trader & EMA Rainbow Trend EA
July 16, 2026 • 18 min read • Gold Trading, MT5 EAs, XAUUSD, Free Download
Gold (XAUUSD) remains the most traded commodity in the retail forex space, with daily volatility averaging 1.2–2.5% and a strong tendency toward momentum moves during London and New York overlap. Algorithmic trading on Gold offers significant advantages: removing emotional bias, executing within milliseconds of technical conditions, and managing risk across multiple timeframe confirmations simultaneously.
This article presents two free, production-ready MT5 Expert Advisors built specifically for XAUUSD. Each EA employs a fundamentally different approach to Gold trading, giving you flexibility based on market conditions and your personal risk preferences.
Both EAs have been backtested on real tick data from January to July 2026. You can download the compiled .ex5 files free of charge below. For those who need the full MQL5 source code, white-label rebranding, or custom modifications, we offer licensing packages at affordable prices.
EA 1: RSI Pair Trader News
Core Strategy — RSI Mean-Reversion with Pair Recovery
The RSI Pair Trader News EA is a non-martingale, non-grid mean-reversion system specifically designed for Gold's tendency to overextend and snap back. The EA monitors six timeframes simultaneously (M5, M15, M30, H1, H4, D1) using a 22-period RSI. When any timeframe displays an RSI reading at or above 80 (overbought) or at or below 20 (oversold), the EA enters Trade 1 with a fixed $17 profit target.
If Trade 1 hits a predefined loss threshold (default $27 scaled by lot size), the EA deploys Trade 2 in the same direction with a smaller lot size (0.03 vs 0.05) and a combined basket profit target of $12. If Trade 1 closes in profit, the EA waits for RSI to return from extreme toward neutral (77/23) before placing Trade 2 as a trend-continuation entry. All positions are force-closed at 23:55 server time daily, ensuring no overnight gap exposure.
How the 2-Trade Pair Logic Works
Trade 1 (0.05 Lot)
- Trigger: RSI ≥ 80 (sell) or ≤ 20 (buy) on any of 6 TFs
- Entry: Market order, no SL/TP set on broker
- Target: Close at $17 net profit (EA monitors tick-by-tick)
- Loss threshold: -$27.0 or scaled equivalent
Trade 2 (0.03 Lot)
- Scenario A (Recovery): Placed when T1 hits -$27 loss
- Scenario B (Normal): Placed when T1 closed at profit + RSI pulls back to 77/23
- Target: Combined T1 + T2 basket closed at $12 net profit
Key Features
Unlike grid/martingale systems that double down, this uses a smaller second entry (0.03 vs 0.05) with a tight combined profit target, preventing catastrophic drawdowns.
Fetches real-time economic calendar from Forex Factory (XML/JSON). Blocks new entries 90 minutes before and after high-impact news events. Configurable update interval.
Avoids entries during Friday close and Monday open gaps (configurable hours). Prevents slippage on weekend gap reversals common in Gold.
All positions force-closed at 23:55 daily. Day state (trades taken, profit targets hit) completely resets at midnight. No carryover risk.
Scans M5, M15, M30, H1, H4, D1 concurrently. Trades trigger on the first timeframe hitting RSI extremes, capturing scalping and swing opportunities alike.
Configurable maximum spread (default 300 points). Blocks entries during high-volatility periods with excessive spreads. Gold typically sees wider spreads during Asian session.
Input Parameters
| Parameter | Default | Description |
|---|---|---|
| InpRSIPeriod | 22 | RSI calculation period |
| InpRSISellTrigger | 80 | RSI level for sell entry (overbought) |
| InpRSIBuyTrigger | 20 | RSI level for buy entry (oversold) |
| InpLot1 | 0.05 | Lot size for Trade 1 |
| InpLot2 | 0.03 | Lot size for Trade 2 |
| InpProfit1USD | 17.0 | Trade 1 profit target in USD |
| InpProfit2USD | 12.0 | Combined basket profit target in USD |
| InpRecoveryLossUSD | 27.0 | Loss threshold to trigger recovery Trade 2 |
| InpMaxTradesPerDay | 5 | Maximum number of entries per day |
| InpMaxSpreadPts | 300 | Maximum spread in points to allow entry |
| InpUseNewsFilter | true | Enable news blackout filter |
| InpNewsMinsBefore | 90 | Minutes before news to block trades |
| InpUseSessionFilter | true | Enable weekend gap avoidance |
Backtest Performance (Jan 2026 – Jul 2026)
| Metric | Value |
|---|---|
| Initial Deposit | $1,000 |
| Final Balance | $1,985.74 |
| Net Profit | +$985.74 (+98.57%) |
| Total Deals | 155 |
| Max Drawdown | $208 (one Trade 2 gap close at 23:55) |
| Symbol | XAUUSD (Gold) |
| Testing Period | 6.5 months (Jan 1 – Jul 14, 2026) |
Recommended Settings for XAUUSD
For $1,000 accounts: keep default lots (0.05/0.03). For $500 accounts: reduce to 0.03/0.02. Enable the news filter (default 90/90 minutes). Enable the session filter to avoid Friday 2h and Monday 2h gaps. The EA has been optimized for Gold's typical 15–30 pip spreads during London/NY session. Works on any broker with hedging-enabled MT5 accounts.
EA 2: EMA Rainbow Trend EA
Core Strategy — 6-EMA Rainbow Trend Following with 7-Target Profit Taking
The EMA Rainbow Trend EA is a trend-following system that replicates Pine Script v6 logic for detecting sequential EMA alignment. It uses six Exponential Moving Averages (30, 35, 40, 45, 50, 60) on H1 — a classic "rainbow" configuration where each EMA is slightly slower than the previous. A bullish signal occurs when all six EMAs are in ascending order (fastest at top), and a bearish signal when in descending order (fastest at bottom). The signal fires only on trend change (previous bar did not have alignment), preventing re-entries on established trends.
What sets this EA apart is its professional-grade trade management. Instead of a single TP and SL, it uses 7 Risk-Reward targets (1R to 7R) with a hybrid partial-close and trailing system. At TP1 (1R), 30% of the position is closed and stop moves to break-even. At TP2 (2R), another 30% is closed and the remaining 40% rides the trend with swing-based trailing stops. This structure ensures that 60% of the position banks profit early while the remainder runs for maximum gain.
How the EMA Rainbow Signal Works
Bullish Rainbow
EMA30 > EMA35 > EMA40 > EMA45 > EMA50 > EMA60
All 6 EMAs in perfect ascending order
Bearish Rainbow
EMA30 < EMA35 < EMA40 < EMA45 < EMA50 < EMA60
All 6 EMAs in perfect descending order
Neutral / Chop
EMAs crossed / no clear alignment
EA closes all positions and waits
Key Features
Seven take-profit levels from 1R to 7R, each configurable independently. Default: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0. Later targets act as runners.
TP1: close 30% + move SL to BE. TP2: close another 30% + start swing trail. Remaining 40% runs with trailing stop that adjusts with price action.
Only takes signals when H4 and D1 trends align with H1. Prevents entries during conflicting higher-timeframe trends — reduces false signals by approximately 60%.
After TP1 moves SL to break-even, adds a second position at 50% of original lot size. Since the first position is now risk-free, the pyramid position carries no net portfolio risk.
Skips entries when current ATR(14) is below 80% of the 20-bar ATR average. Filters out low-volatility chop zones where trend strategies underperform.
After TP2, if price pulls back to EMA30, the EA re-enters at half lot with SL at original entry. Captures trend continuation moves after brief retracements.
Supports % risk per trade (default 1% of account balance) or fixed lot. Dynamically calculates lot size based on stop distance and account equity.
Displays trend direction (Bullish/Bearish/Neutral) for H1, H4, D1, W1, MN1 directly on the chart. Helps traders visually confirm market context.
Input Parameters
| Parameter | Default | Description |
|---|---|---|
| InpSLType | SL_Mid | Swing lookback: Tiny(6), Small(12), Mid(18), Large(24) bars |
| InpRiskPercent | 1.0 | % of account balance risked per trade (0 = use fixed lot) |
| InpLotSize | 0.01 | Fixed lot (ignored if RiskPercent > 0) |
| InpEMALen1–6 | 30,35,40,45,50,60 | EMA periods for the rainbow |
| InpTP1RR–InpTP7RR | 1.0–7.0 | Risk-Reward multiplier for each target level |
| InpTP1ClosePct | 30.0 | % of position closed at TP1 |
| InpTP2ClosePct | 30.0 | % of position closed at TP2 |
| InpMoveToBE | true | Move SL to entry price after TP1 |
| InpTrailAfter | true | Enable swing trailing after TP2 |
| InpCloseOnNeutral | true | Close all when rainbow becomes neutral |
| InpMTFFilter | true | Require H4+D1 alignment with H1 |
| InpPyramid | true | Add 2nd position at BE after TP1 |
| InpATRFilter | true | Skip entries in low-volatility chop |
| InpReEntryPullback | true | Re-enter on pullback to EMA30 after TP2 |
Backtest Performance
| Metric | Value |
|---|---|
| Symbol | XAUUSD (Gold) |
| Timeframe | H1 (with H4 + D1 confluence) |
| Stop Loss Style | Swing-based (18-bar lookback default) |
| Profit Targets | 7 levels (1R to 7R), hybrid partial close + trail |
| Filters Active | MTF, ATR, Neutral Close, Pyramiding, Pullback Re-Entry |
| Trading Hours | 24/5 on H1 bar close |
Recommended Settings for XAUUSD
Use SL_Mid (18) for Gold's average daily range. Set risk to 1% per trade for $1,000 accounts. Keep all filters enabled: MTF reduces false signals in ranging markets, ATR prevents entry during quiet Asian sessions, and neutral close protects profits when trend flattens. Works best when Gold shows directional bias of at least 50 pips/day.
Which EA Should You Use?
Both EAs are complementary rather than competitive. Here is a simple framework to decide:
- Use RSI Pair Trader News when Gold is ranging between support and resistance with frequent RSI extremes (80/20). The system thrives on snap-backs and mean reversion.
- Use EMA Rainbow Trend EA when Gold is in a clear directional trend (e.g., sustained sell-off or rally with H4/D1 alignment). The system captures extended moves with its 7-target structure.
- Run both simultaneously on separate charts for portfolio diversification. Since they use fundamentally different logic (mean-reversion vs trend-following), one typically performs well while the other sits out during unfavorable conditions.
How to Install on MT5
- Download the .ex5 file(s) from the download section below.
- Open your MT5 terminal and go to File → Open Data Folder.
- Navigate to MQL5 → Experts and paste the .ex5 file(s) there.
- Restart MT5 or right-click Navigator → Expert Advisors → Refresh.
- Drag the EA onto a XAUUSD chart (any timeframe).
- Enable Automated Trading (Alt+T) and Allow DLL Imports if using the news filter.
- Configure input parameters as desired and click OK.
Free Download — MT5 .ex5 Files
Download the compiled Expert Advisors for free. No registration or email required. Simply download and install.
RSI Pair Trader News
RSI mean-reversion with recovery pair logic
RSIPairTraderNews.ex5Size: ~65 KB | MT5 only | Hedging account
EMA Rainbow Trend EA
6-EMA rainbow trend following with 7-TP trail
ShabibEMA.ex5Size: ~75 KB | MT5 only | Any account type
Source Code, White Label & Licensing
The free .ex5 files above are fully functional, compiled Expert Advisors ready for live trading. However, if you need any of the following, we offer affordable licensing packages:
- Full MQL5 Source Code — Complete .mq5 source files with detailed comments. Modify indicators, add filters, change logic.
- White-Label Rebranding — Replace all internal branding with your company name. Perfect for prop firms, signal services, and trading educators.
- Custom Modifications — Add additional indicators, change entry logic, integrate with your existing trade management system.
- Unlimited License — Remove any time or account restrictions for commercial deployment.
For pricing and inquiries: enquiry@algospecial.com or use our contact form.
Why Gold (XAUUSD) for Algorithmic Trading?
Gold offers several structural advantages for automated trading that make it our preferred instrument:
- High Volatility: Average daily range of 1.2–2.5% provides ample profit potential for both mean-reversion and trend-following strategies.
- Trend Persistence: Gold tends to trend strongly during macro shifts (rate decisions, geopolitical events, inflation data), making trend-following EAs particularly effective.
- Predictable RSI Behavior: Gold frequently reaches RSI extremes during London/NY overlap before mean-reverting — the core premise of the RSI Pair Trader.
- 24/5 Liquidity: Tight spreads during peak hours (typically 15–30 points) and deep liquidity ensure consistent trade execution without significant slippage.
- Correlation with Fundamentals: Gold responds predictably to USD strength, real yields, and risk sentiment — the news filter in RSI Pair Trader is especially effective at avoiding false signals during key economic releases.
- Works on Multiple Timeframes: Unlike some instruments that only work on specific TFs, Gold shows robust behavior from M5 scalping to H4 swing trading.
Frequently Asked Questions
Are these EAs really free?
Yes. The compiled .ex5 files are 100% free to download and use on any MT5 terminal. No email, registration, or payment required.
Do these EAs work on netting accounts?
The RSI Pair Trader requires a hedging account because it manages multiple positions (Trade 1 and Trade 2) simultaneously. The EMA Rainbow Trend EA works on both hedging and netting accounts since it typically holds only one position at a time.
Can I use these EAs on instruments other than XAUUSD?
Both EAs will work on any instrument. However, they have been optimized and backtested specifically for XAUUSD. Other pairs may require parameter adjustments. The EMA Rainbow Trend EA, being a pure trend-follower, works well on indices (US30, NAS100) and major forex pairs (EURUSD, GBPUSD).
Do the EAs use martingale or grid strategies?
Neither EA uses martingale (doubling down after loss) or grid (scaling into losing positions). The RSI Pair Trader uses a scaled-down recovery trade at a fixed loss threshold with a tight combined profit target. The EMA Rainbow Trend EA uses single positions with partial closes and zero-risk pyramiding.
What is the minimum account size?
$500 minimum for RSI Pair Trader (with reduced lots), $200 for EMA Rainbow Trend EA. For optimal risk management, we recommend $1,000+ accounts.
Where can I buy the source code?
Contact us via enquiry@algospecial.com or use our contact form. We offer source code, white-label rebranding, custom modifications, and unlimited licensing at competitive prices.
Do you offer custom EA development?
Yes. We specialize in custom MQL4/MQL5 development for all trading platforms. Visit our services page or hire an MQL5 developer for more information.