XAU/USD automation

XAUUSD bots: the instrument details that break automated systems

Most XAUUSD bot failures are not strategy failures. They are specification failures: the wrong contract size, the wrong pip definition, or a symbol name that does not resolve on the broker it was pointed at.

  • Contract size traps
  • The 0.1 vs 0.01 pip problem
  • Symbol naming across brokers
  • Rollover and gaps

Last reviewed by the MarketPro research desk · Editorial policy

Short answer

An XAUUSD bot is an automated system trading spot gold against the US dollar. Before its strategy matters at all, three specification details have to be right: the contract size (100 ounces at most brokers, 10 at some), the pip definition (0.1 by convention, but 0.01 on some platforms), and the exact symbol name (XAUUSD, GOLD, XAUUSD.m and others all exist). Getting any of them wrong changes position size by a factor of ten or more.

Key takeaways

  • Contract size is not standard. 100 ounces at most brokers, 10 at some. A bot assuming the wrong one is out by 10×.
  • The pip definition varies: 0.1 conventionally, 0.01 on some platforms. Work in price distance, not pips.
  • Symbol names differ. XAUUSD, GOLD, XAUUSD.m, XAUUSDm. A hard-coded name silently fails on the wrong broker.
  • Rollover widens the spread every day at a predictable time. A bot with no time filter enters into it.
  • Gold's stop level and freeze level are often wider than a currency pair's, so tight stops may be rejected outright.

The contract-size trap

Most brokers define one standard XAUUSD lot as 100 troy ounces. Some define it as 10. A few offer both, on different account types.

A bot that assumes 100 ounces on a broker using 10 will open positions a tenth of the intended size. Annoying, but survivable. A bot that assumes 10 on a broker using 100 opens positions ten times too large, and a single trade can take a quarter of the account.

The fix is straightforward and frequently skipped: read the contract size from the platform at runtime rather than hard-coding it. In MQL that is SymbolInfoDouble(symbol, SYMBOL_TRADE_CONTRACT_SIZE). Any gold EA that does not do this has an assumption baked into it that may not match your broker.

The pip ambiguity

Gold is quoted to two decimals. Whether a "pip" means 0.1 or 0.01 is a convention, not a standard, and both are in use.

At 0.1, a standard lot is $10 per pip and a typical daily range is 150–300 pips. At 0.01, the same lot is $1 per pip and the same range is 1,500–3,000 pips. A "150-pip stop" therefore means either 15.00 or 1.50 in price, which are entirely different trades.

Two practical rules. In signals and documentation, use price distance, "stop at 2331.00" cannot be misread. In code, derive from the symbol via point size and digits rather than assuming. MarketPro's gold signals always state absolute price levels for this reason.

Symbol naming and execution constraints

Gold appears under different names across brokers: XAUUSD, GOLD, XAUUSD.m, XAUUSDm, XAUUSD-ECN and others, often with a suffix identifying the account type. A bot with a hard-coded symbol string fails silently. No error, no trades, no obvious cause.

Three execution constraints also bite harder on gold than on currency pairs:

  • Stop level. The minimum distance from current price at which a stop or limit may be placed. On gold this is often much wider than on forex, so a tight stop can be rejected outright.
  • Freeze level. How close to price an order can be before it can no longer be modified. Which matters precisely when a bot most wants to move a stop.
  • Rollover. A daily window where the spread widens sharply on every broker. A bot without a time filter enters into it and pays several times the normal cost.

What an automated system cannot do

Four limits are structural rather than a matter of build quality, and understanding them is most of what separates people who use automation well from people who lose money to it.

It cannot know what it has not been shown. A rule set encodes past relationships. When the regime changes (a trending market turns to chop, a correlation that held for two years breaks) the system keeps applying yesterday's logic with full confidence and no awareness that anything has changed.

Backtests overstate almost everything. A backtest with clean fills, fixed spread and no slippage is not a simulation of trading, it is a simulation of arithmetic. Add realistic spread, variable execution and the requeues that happen in fast markets, and a strategy that looked excellent frequently becomes marginal.

Optimisation finds coincidences. Tune enough parameters against enough history and you will find a setting that fits it perfectly. That setting describes the noise in that particular sample, not a property of the market, and it stops working the moment it meets data it was not fitted to. This is curve-fitting, and it is the single most common reason a purchased system fails.

Recovery logic hides risk instead of removing it. Martingale and grid systems produce beautiful equity curves for months, because doubling into a losing position converts many small losses into rare enormous ones. The curve is not evidence of an edge; it is evidence that the loss has not arrived yet.

The MarketPro Expert Advisor

MarketPro is building an Expert Advisor for MetaTrader 4 and MetaTrader 5. It is not available to download yet, and this page will say so until it is.

What is open today is the waiting list. Install the app, open the EA tab, and join it; everyone on the list is emailed when the builds go live. There is no charge and no card involved in joining.

When it does ship, three things will be true about it by design:

  • You install and run it. It executes on your terminal, on your account, under your configuration. MarketPro never touches your account and exercises no discretion over your funds.
  • It ships with a kill switch and an explicit as-is licence with no performance guarantee.
  • Availability is limited by region. Distribution is restricted, and eligibility is determined by residence rather than by a checkbox on a page.

Meanwhile the thing that is live is the signal feed: vetted trade ideas with entry, stop and three targets that you place yourself. That is the manual equivalent of what the EA will automate, and it is available today with one free signal a day.

Written and reviewed by the MarketPro research desk

MarketPro is a trading-signal and trading-education app operated by Harajuku Holdings LTD (Cyprus). Our signal desk publishes and tracks every trade idea in-app, and every page here is checked against the app's live behaviour before publishing. Last reviewed . How we produce signals and content · About MarketPro

MarketPro EA status: coming soon

The MarketPro Expert Advisor for MetaTrader 4 and MetaTrader 5 is not available to download yet. The in-app waiting list is open, and everyone on it is emailed the moment the builds go live. Vetted signals are available today in the app. Get MarketPro free and join the EA waiting list from the EA tab.

The MarketPro Expert Advisor is software you install and run yourself on your own MetaTrader terminal. MarketPro does not trade on your behalf, does not manage your account, and exercises no discretion over your funds. It is supplied as-is with no performance guarantee, and availability is limited by region.

FAQ

Frequently asked questions

What is the contract size for XAUUSD?
Most brokers use 100 troy ounces per standard lot, though some use 10. Always read it from the platform rather than assuming. In MQL, SymbolInfoDouble with SYMBOL_TRADE_CONTRACT_SIZE. Getting it wrong changes your position size by a factor of ten.
Why does my gold bot not open any trades?
The most common cause is a symbol name mismatch: the EA looks for "XAUUSD" and the broker calls it "GOLD" or "XAUUSD.m". Second most common is a stop-level rejection, where the stop is closer to price than the broker permits on gold. Check the Experts and Journal tabs in MetaTrader for the actual error.
Is one pip on gold 0.1 or 0.01?
Both conventions are in use, which is exactly why it causes so many errors. 0.1 is the more common convention and makes a standard lot about $10 per pip. Avoid the ambiguity entirely by working in absolute price distance rather than in pips.
Trade · Learn · Earn

Unambiguous gold levels

MarketPro publishes XAU/USD signals with absolute price levels, so there is nothing to misread. One free vetted signal a day.

Not investment advice. Past performance is not indicative of future results.