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:

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

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