Advanced Gold Trading V6.4 EA for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The Advanced Gold Trading V6.4 EA is an automated Expert Advisor for MT4 and MT5. It opens and manages real trades on its own. The strategy is a trend robot built for gold: a fast EMA crosses a slow EMA on the closed bar, filtered by an ATR movement gate and an EMA200 trend filter. It places live orders, sets stops, and closes them without your input.

Risk warning

This EA trades live capital automatically once you enable AutoTrading. Every trade opens with a mandatory stop loss attached. Test it on a demo account first, over enough bars to judge it. Only risk money you can afford to lose.

How the Advanced Gold Trading V6.4 EA trades

The Advanced Gold Trading V6.4 EA acts on closed bars only. It reads two moving averages on each new bar. When the fast EMA crosses above the slow EMA, it prepares a long. When the fast EMA crosses below, it prepares a short.

Two filters must agree first. An ATR gate checks that recent bars moved enough to justify a trade. A 200-period trend filter confirms price sits on the correct side of the longer trend. Only then does the EA send the order.

Each trade opens with a fixed stop loss and take profit in pips. An optional trailing stop can lock in gains as price runs. The EA can also close a position early when an opposite signal prints. It manages one position at a time by default.

Settings

Setting What it does Default
FastEma Fast EMA period for the cross 21
SlowEma Slow EMA period for the cross 89
AtrPeriod ATR period for the movement gate 14
MinAtrPips Minimum ATR in pips (0 = gate off) 0.0
UseTrendFilter Require price on the correct side of the trend MA true
TrendMaPeriod Period of the trend filter MA 200
MoneyMgmt Sizing mode: fixed lot or risk percent FIXED_LOT
Lots Fixed lot size per trade 0.01
RiskPercent Risk per trade when using percent sizing 1.0
StopLossPips Stop loss distance in pips 300
TakeProfitPips Take profit distance in pips 600
UseTrailingStop Turn the trailing stop on or off false
TrailStartPips Profit in pips before trailing starts 300
TrailStepPips Step size for each trail move 50
CloseOnOppositeSignal Close the trade on a reverse signal true
MagicNumber Order tag that isolates this EA 20260723
MaxOpenTrades Maximum trades open at once 1
MaxSpreadPoints Skip entries above this spread 50
Slippage Allowed slippage in points 30

Backtest results

advanced gold trading v6.4 ea MT4 Strategy Tester backtest equity curve on USDCHF H4
MetaTrader 4 Strategy Tester backtest – USDCHF H4 (net 45.38, profit factor 2.16, 8 trades)

For more like this, browse the more Expert Advisors for MT4 and MT5 or jump to the full free MT4 and MT5 indicators.

This is a MetaTrader 4 Strategy Tester run on USDCHF H4 using the open-prices model on historical data. The run booked a net profit of 45.38 in account currency. The profit factor was 2.16. It took only 8 trades, which is a very small sample. Maximum drawdown was 0.42%, and profitable trades came to 37.5%. The same trend logic is designed for gold (XAUUSD) and other trending instruments, though the numbers above are from USDCHF, not a gold run. This run is optimized on past data, and past performance is not indicative of future results.

How to install on MT4 and MT5

This Expert Advisor installs into the MetaTrader Experts folder (MQL4/Experts for MT4, MQL5/Experts for MT5) and starts trading once you enable AutoTrading. For the full step-by-step with screenshots for both platforms, see the complete guide to installing MT4 and MT5 Expert Advisors.

Best practices

  • Run the EA on a demo account first until you trust it.
  • Use a VPS for steady 24/5 uptime.
  • Keep the stop loss on at all times.
  • Start with 0.01 lots or 1% risk while you learn its behaviour.
  • Re-test on your broker’s data before you go live.
  • Do not run two EAs on the same magic number.

For background on this style of trading, see Algorithmic Trading at Investopedia.

Get the Advanced Gold Trading V6.4 EA for MT4 and MT5

Enter your email below and the Advanced Gold Trading V6.4 EA arrives instantly for MT4 and MT5. We also send updates when new versions ship.

Download this Expert Advisor free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

The download is free after one email confirmation.

Related on forexmt4systems.com: Gold Scalping Strategy.

FAQ

Does the Advanced Gold Trading V6.4 EA place trades automatically?
Yes. Once you enable AutoTrading on MT4 or Algo Trading on MT5, it opens, modifies, and closes trades on its own. You keep full control by turning that button off.

What stop loss does it use?
Every trade opens with a fixed stop loss in pips, set by the StopLossPips input. An optional trailing stop can tighten the stop as the trade moves in your favour.

Which pairs and timeframe should I run it on?
The trend logic is built for gold (XAUUSD) and other trending instruments. In testing it scored best on USDCHF H4, so that pair and timeframe are a fair starting example.

Can I change the risk or lot size?
Yes. Switch MoneyMgmt between a fixed lot and a risk percent. Set Lots for a fixed size, or RiskPercent to size each trade off your balance.

Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results.

Background reading: why an EA needs a VPS.

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment