Skip to main content
ForexCopilotEA

Running an Expert Advisor on gold (XAUUSD): what to check first

By Benjamin Lee · Published 2026-10-09 · Updated 2026-10-30 · 4 min read

You can run an Expert Advisor on gold (XAUUSD) in MetaTrader 5 only if the EA was designed for it, and only after you check your broker's contract size, spread and symbol name. Gold moves faster and in larger steps than most currency pairs, so settings and expectations that suit EURUSD do not carry over. On a 100-ounce contract, every 1 USD move in the gold price is worth 100 USD per lot.

Check the contract specification

A standard lot of gold is commonly 100 troy ounces, but brokers define the contract differently. Open the symbol in Market Watch, choose Specification, and read the contract size, minimum lot, lot step, tick size and digits.

The same lot size therefore carries a different dollar risk on gold than on a currency pair. Work out the value of a one-dollar move per lot on your broker before choosing a lot size.

Spreads and commissions matter more on gold

Gold spreads are quoted in points and can widen sharply around news releases and at the daily rollover, which hurts short-term EAs most. Compare the typical and the maximum spread, and add any commission to get the true cost of a trade.

Expect larger swings and plan for news

Gold often reacts strongly to US economic data, central bank decisions and geopolitical events. Price can jump through a stop level, which is called slippage, so a stop loss does not guarantee the exit price.

  • Check whether the EA has a news filter or a spread filter, and how to set it.
  • Consider pausing the EA around major scheduled releases if its manual recommends it.
  • Use a lot size you could still tolerate if a stop is filled worse than planned.

Use the right symbol name

Brokers name gold differently, for example XAUUSD, XAUUSDm, GOLD or XAUUSD.pro. Attach the EA to the chart of your broker's gold symbol and check the EA manual to see whether it expects a specific name or a suffix setting.

Gold lot size and risk: a worked example in dollars

These numbers are hypothetical and assume a 100-ounce contract, so confirm yours first. At 100 ounces per lot, a 1 USD move in the gold price is worth 100 USD per lot, or 10 USD at 0.10 lots. A 10 USD move against a 0.10-lot position is therefore a 100 USD loss, and a 5 USD move is 50 USD.

Costs scale the same way. If the broker quotes gold with 2 digits, a spread of 30 points is 0.30 USD, which costs about 3 USD on a 0.10-lot trade before commission. If a stop is filled 1 USD worse than planned because of slippage, the loss on that trade is 10 USD higher than the stop distance implied. Choose a lot size from the maximum amount you can lose on one trade, then check the dollar value of the stop distance, not only the number of points.

How gold differs from a currency pair like EURUSD

  • Contract size: gold is usually quoted per ounce with a large contract, so each lot carries a different value per price move.
  • Digits and points: a point on gold is not the same size as a point on a 5-digit currency pair, so stop and target inputs in points mean different distances.
  • Volatility: daily ranges are often wide, so stops and targets that work on a quiet pair can be too tight.
  • Spread behaviour: spreads can widen sharply around news and at rollover.
  • Trading hours: sessions and the daily break differ by broker, so check the symbol Specification.

How to attach an EA to gold in MetaTrader 5, step by step

  • Open Market Watch (Ctrl+M), right-click, choose Symbols and find your broker's gold symbol. Add it and open a chart.
  • Read the Specification for contract size, minimum lot, lot step, digits and trade mode.
  • Set the chart to the timeframe the EA's manual names, then attach the EA and load its setfile.
  • If the EA has a symbol-suffix or symbol-name input, set it to match your broker's gold symbol.
  • Check any spread and news filters, and set them according to the manual.
  • Enable Algo Trading, and watch the Experts tab for the first trades or filter messages.

Test before going live

Backtest in the Strategy Tester using real ticks if your broker provides them, then run the EA on a demo account of the same broker. Past results do not predict future results, and gold conditions change over time, so start live with the smallest lot size.

Include high-volatility periods in the test range, such as weeks with major data releases, rather than only quiet months. If the results change a lot between test windows, treat that as information about the EA's sensitivity.

Common mistakes when running an EA on gold

  • Copying lot sizes from a currency pair setup.
  • Assuming a stop loss guarantees the exit price.
  • Attaching a forex-pair EA to XAUUSD without testing it there.
  • Setting the max spread input so high that the spread filter never blocks a trade.
  • Forgetting that the symbol name has a suffix, then wondering why the EA never trades.

Frequently asked questions

Can I use a forex EA on gold?

Only if the EA was designed for it. Gold has a different contract size, volatility and spread behaviour, so an EA built for currency pairs needs its own testing and settings on XAUUSD.

Why does my gold EA not trade?

Common causes are the wrong symbol name, Algo Trading disabled, a spread filter blocking entries, or a lot size below the broker's minimum. Check the Experts tab in the Toolbox for the exact message.

Is a stop loss guaranteed on gold?

No. During fast markets the fill can be worse than the stop price because of slippage and wider spreads.

What is the best timeframe for a gold EA?

It depends on the EA. Each one is designed and tested for a specific symbol and timeframe, so use the one named in its user manual rather than choosing by preference. Changing the timeframe changes the signals and the risk.

How much is one lot of gold worth per dollar move?

If your broker's contract size is 100 ounces, one lot gains or loses 100 USD for each 1 USD move in the price. Brokers can use a different contract size, so read the symbol's Specification in Market Watch before sizing a trade.

Why is the spread on gold so wide at times?

Liquidity thins around major news, at the daily rollover and in the quiet hours between sessions, and brokers widen spreads to compensate. Use the EA's max spread filter so it does not open trades at those moments.

Trading foreign exchange, gold and CFDs carries a high level of risk and may not be suitable for all investors. Past performance, backtests and live results do not guarantee future returns. This guide is general education, not financial advice.

More on gold (XAUUSD) Expert Advisors

More guides