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

Two Free MT5 EAs — Download .ex5 Below

No email required • Ready to install • For XAUUSD (Gold) & other instruments

Jump to 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.

Quick Comparison

Feature RSI Pair Trader News EMA Rainbow Trend EA
Core StrategyRSI mean-reversion pair trading6-EMA rainbow trend following
Entry SignalCurrent candle RSI 80/20 on any TF (M5–D1)EMA rainbow sequential alignment on H1
Take ProfitFixed USD targets ($17 T1, $12 T2 basket)7-level RR-based targets (1R to 7R)
Stop LossNo SL — recovery trade + 23:55 forced closeSwing-based SL (configurable: 6–24 bars)
Trade ManagementT1 profit target → T2 entry (recovery or normal)Hybrid: partial close at TP1/TP2, move to BE, swing trail
News FilterYes — Forex Factory XML/JSON, 90-min bufferNo (MTF + ATR filters instead)
MTF Confluence6 timeframes scanned (M5–D1)H4 + D1 must align with H1
Recovery SystemScaled-second entry on T1 lossN/A (single position + pyramid add at BE)
PyramidingNoYes — 2nd position at BE after TP1 (50% lot)
Max Daily Trades5 (configurable)Unlimited (1 per signal, trend-dependent)
Best ForRanging markets with RSI extremesTrending markets with multi-TF alignment
Backtest Net Profit+98.7% in 6.5 monthsView report below
Download .ex5 RSIPairTraderNews.ex5 ShabibEMA.ex5

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

Non-Martingale Recovery

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.

News Filter Integration

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.

Session & Gap Filter

Avoids entries during Friday close and Monday open gaps (configurable hours). Prevents slippage on weekend gap reversals common in Gold.

Daily Hard Reset

All positions force-closed at 23:55 daily. Day state (trades taken, profit targets hit) completely resets at midnight. No carryover risk.

Multi-Timeframe RSI Scan

Scans M5, M15, M30, H1, H4, D1 concurrently. Trades trigger on the first timeframe hitting RSI extremes, capturing scalping and swing opportunities alike.

Spread Protection

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

RSI Pair Trader EA Input Parameters
ParameterDefaultDescription
InpRSIPeriod22RSI calculation period
InpRSISellTrigger80RSI level for sell entry (overbought)
InpRSIBuyTrigger20RSI level for buy entry (oversold)
InpLot10.05Lot size for Trade 1
InpLot20.03Lot size for Trade 2
InpProfit1USD17.0Trade 1 profit target in USD
InpProfit2USD12.0Combined basket profit target in USD
InpRecoveryLossUSD27.0Loss threshold to trigger recovery Trade 2
InpMaxTradesPerDay5Maximum number of entries per day
InpMaxSpreadPts300Maximum spread in points to allow entry
InpUseNewsFiltertrueEnable news blackout filter
InpNewsMinsBefore90Minutes before news to block trades
InpUseSessionFiltertrueEnable weekend gap avoidance

Backtest Performance (Jan 2026 – Jul 2026)

RSI Pair Trader EA Backtest Report
MetricValue
Initial Deposit$1,000
Final Balance$1,985.74
Net Profit+$985.74 (+98.57%)
Total Deals155
Max Drawdown$208 (one Trade 2 gap close at 23:55)
SymbolXAUUSD (Gold)
Testing Period6.5 months (Jan 1 – Jul 14, 2026)
RSI Pair Trader EA Holding Analysis

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

7-Level RRR Target Structure

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.

Hybrid TP/SL Management

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.

MTF Confluence Filter

Only takes signals when H4 and D1 trends align with H1. Prevents entries during conflicting higher-timeframe trends — reduces false signals by approximately 60%.

Zero-Risk Pyramiding

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.

ATR Volatility Filter

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.

Pullback Re-Entry

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.

Risk-Based Position Sizing

Supports % risk per trade (default 1% of account balance) or fixed lot. Dynamically calculates lot size based on stop distance and account equity.

Multi-TF Dashboard

Displays trend direction (Bullish/Bearish/Neutral) for H1, H4, D1, W1, MN1 directly on the chart. Helps traders visually confirm market context.

Input Parameters

EMA Rainbow Trend EA Input Parameters
ParameterDefaultDescription
InpSLTypeSL_MidSwing lookback: Tiny(6), Small(12), Mid(18), Large(24) bars
InpRiskPercent1.0% of account balance risked per trade (0 = use fixed lot)
InpLotSize0.01Fixed lot (ignored if RiskPercent > 0)
InpEMALen1–630,35,40,45,50,60EMA periods for the rainbow
InpTP1RR–InpTP7RR1.0–7.0Risk-Reward multiplier for each target level
InpTP1ClosePct30.0% of position closed at TP1
InpTP2ClosePct30.0% of position closed at TP2
InpMoveToBEtrueMove SL to entry price after TP1
InpTrailAftertrueEnable swing trailing after TP2
InpCloseOnNeutraltrueClose all when rainbow becomes neutral
InpMTFFiltertrueRequire H4+D1 alignment with H1
InpPyramidtrueAdd 2nd position at BE after TP1
InpATRFiltertrueSkip entries in low-volatility chop
InpReEntryPullbacktrueRe-enter on pullback to EMA30 after TP2

Backtest Performance

EMA Rainbow Trend EA Backtest Report EMA Rainbow Trend EA Holding Analysis
MetricValue
SymbolXAUUSD (Gold)
TimeframeH1 (with H4 + D1 confluence)
Stop Loss StyleSwing-based (18-bar lookback default)
Profit Targets7 levels (1R to 7R), hybrid partial close + trail
Filters ActiveMTF, ATR, Neutral Close, Pyramiding, Pullback Re-Entry
Trading Hours24/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

  1. Download the .ex5 file(s) from the download section below.
  2. Open your MT5 terminal and go to File → Open Data Folder.
  3. Navigate to MQL5 → Experts and paste the .ex5 file(s) there.
  4. Restart MT5 or right-click Navigator → Expert Advisors → Refresh.
  5. Drag the EA onto a XAUUSD chart (any timeframe).
  6. Enable Automated Trading (Alt+T) and Allow DLL Imports if using the news filter.
  7. Configure input parameters as desired and click OK.

Important: This EA requires a hedging account (retail hedging mode). It will not initialize on netting accounts. Check your broker's account type before installing.

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.ex5

Size: ~65 KB | MT5 only | Hedging account

EMA Rainbow Trend EA

6-EMA rainbow trend following with 7-TP trail

ShabibEMA.ex5

Size: ~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.
News Trading Integration in MT5 EA Complete MQL5 news filter guide
Live Economic Calendar Real-time forex news & event encyclopedia
Consecutive Candles Grid EA Free grid trading robot for MT5
MT5 Development Services Custom EA & indicator development

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.

Ready to Start Automated Gold Trading?

Download your free MT5 Expert Advisors now and take the first step toward consistent algorithmic Gold trading. No strings attached.

Need the source code? Contact us for white-label and licensing options.