Gold is the most popular non-forex automated trading target on MT5 โ retail traders love it for its clean technicals, high volatility, and relative immunity to central-bank news cycles. But it's also the instrument where automation mistakes cost the most. XAUUSD moves 200โ500 pips in a quiet week; a misconfigured position size or a broken lot-size conversion can blow out an account in hours.
This guide covers automated XAUUSD trading on MT5 properly โ lot-size quirks, session timing, and the specific settings that keep gold strategies profitable instead of painful.
Why XAUUSD is different from forex
Three things make gold unlike EURUSD or GBPJPY:
1. Contract size varies by broker. Most brokers use 100 troy ounces per standard lot, meaning a $1 price move = $100 per lot. Some micro accounts use 1 ounce per lot ($1 per $1 move). A few brokers use 10 ounces. This is the #1 source of "I ran my strategy with $1000 risk and lost $100,000" horror stories. Verify your broker's contract size before going live.
2. Spread is dollars, not fractional pips. A typical XAUUSD spread is $0.20โ$0.50 depending on broker and session. That's 20โ50 "pips" if your platform treats gold pips as $0.01 each, or 2โ5 points if it treats them as $0.10 each. Pip definitions on gold are inconsistent โ again, check with your broker.
3. Volatility is 3โ5ร major forex. EURUSD moves 70โ90 pips a day. XAUUSD moves $15โ$30 per day routinely, and $50+ on FOMC or geopolitical news. Stop distances that work on forex get stopped out instantly on gold.
Setting up an XAUUSD strategy
1. TradingView alert template:
{
"key": "KEY-YOUR-LICENSE-KEY",
"magic": 20001,
"alert_name": "alertX",
"action": "BUY",
"symbol": "XAUUSD",
"price": {{close}},
"sl_pips": 300,
"tp_pips": 600
}
Note the stop and target: 300/600 "pips" on XAUUSD translates to roughly $3/$6 of price movement on a standard 100-oz contract โ a reasonable intraday setup. If your broker defines pips differently, adjust accordingly or switch to sl_price / tp_price absolute values for unambiguous results.
2. EA configuration:
- MagicNumber:
20001(match alert) - MaxPositions:
1โ gold is volatile enough that stacking positions compounds risk fast - DefaultLotSize: start tiny (0.01) until you verify contract-size behavior
- TrailingStopPips:
150(~$1.50) if trailing โ tighter trailing gets shaken out on normal volatility - UseBreakeven:
truewith a trigger of ~$2 profit โ reasonable for intraday gold
3. Critical: verify lot sizing before going live.
On a demo account or with 0.01 lot on real, place one trade. When it closes, check: did the profit/loss match what a $1 move ร contract size ร lot would imply? If not, something is off โ stop and debug before scaling up.
When to trade XAUUSD automatically
Gold sessions don't line up with forex sessions as cleanly as major pairs:
| Session (UTC) | Gold behavior | Automation-friendly? |
|---|---|---|
| 00:00โ07:00 (Asia) | Asian central banks and PBoC activity โ directional moves possible | Yes, if strategy is designed for it |
| 08:00โ12:00 (London) | European institutional flow | Yes |
| 13:00โ17:00 (London+NY) | Peak volume and highest range | Yes โ best window |
| 14:30 (NY open) | Often the daily high/low tested | Excellent for momentum strategies |
| 17:00โ21:00 (NY late) | Trend continuation or reversal | Yes, with widened stops |
| 22:00โ00:00 | Thin liquidity, wide spreads | Skip |
Specific events to avoid: US CPI, FOMC rate decisions, NFP (first Friday of month), major geopolitical announcements. Gold can move $30+ in minutes โ any strategy not specifically designed for news trading should pause during these windows.
Risk sizing for XAUUSD
The math is different from forex because lot size is dollars, not pips:
On a $10,000 account, risking 1% per trade: - $100 risk budget per trade - If your stop is $3 (300 "pips" at $0.01/pip) and 100-oz contract: $100 รท $3 ร 0.01 = ~0.33 lots, or $333 position size - Triple-check this math on your specific broker
Rule of thumb: for your first month of automated XAUUSD trading, use position sizes half what your math tells you is acceptable. Gold's volatility has a way of surprising strategies that were perfectly risk-sized in backtests.
Common pitfalls specific to XAUUSD
- Weekend gaps. Gold often gaps $5โ$15 over weekends. If you hold positions through Friday close, you can wake up Sunday to a stop well past your configured level. Either close all gold positions before weekend or accept gap risk explicitly.
- Broker symbol variations. Some brokers list gold as
XAUUSD, others asGOLD, others asXAU/USDorXAUUSD.pro. The EA's symbol mapping handles most of these, but verify on first run. - Commission vs. all-in spread. Some brokers charge commission on top of raw spreads (common on ECN accounts). Your strategy's expected value must account for both; ignoring commission on gold destroys thin-margin strategies.
- Slippage at session opens. XAUUSD at the NY equity open (14:30 UTC) can slip $0.50+ on market orders. Use limit orders where possible or adjust stop distances to absorb the slippage.
How iNakaTrader handles XAUUSD
XAUUSD is supported on all iNakaTrader tiers โ it's in the Basic tier's "major pairs + XAUUSD" coverage. For active gold traders, the Pro tier unlocks 4-level partial TP, which works well for gold: partial out at $2, $4, $6, $10 to lock in profits while letting the runner work in a trending move.
The EA's broker-agnostic symbol mapping automatically detects whether your broker calls gold XAUUSD, GOLD, or XAUUSD.m, and the contract-size inspection at startup surfaces lot-size mismatches before they cause damage.
Ready to automate your gold strategy? Start with iNakaTrader โ
Related guides: - How TradingView webhook to MT5 works (pillar guide) - TradingView alert to MT5 setup guide - Automated EURUSD trading on MT5 - Automated GBPUSD trading on MT5