XAUUSD
Make a gold (XAUUSD) EA with the Strategy Miner
The Strategy Miner tries thousands of entry and exit combinations on gold price history in your browser, and keeps the few that pass every check. Open the one you like in the Strategy Builder (Pro), then export it as an MT5 Expert Advisor (Pro).
Open the Miner on XAUUSD (Pro) Read the XAU/USD guide
Opens the Miner with XAUUSD, H1 and 4 years filled in. Searching gold takes Pro; without it the page falls back to EURUSD.
10 runs · H1 · 4 years · 2,000 trials
What changes on gold
Gold is not a currency pair, so the Miner does not reuse the forex defaults.
- 1
Costs start at gold's size. The default spread is 60 pips ($0.60), taken from the median bid-ask spread in Dukascopy tick data. A forex pair starts at 1 pip.
- 2
Stops and targets are searched wider. The search range is 40 times the forex range, because gold's hourly ATR is roughly 40 times a forex pair's.
- 3
Gold is measured in its own units. One pip is 0.01, and one lot is 100 ounces.
- 4
The forex cross-check is not used. Gold, silver, indices and oil are not tested against currency pairs, whose price moves are on a different scale.
What ten real runs on gold found
We ran the Miner on XAUUSD ten times with the settings below, changing only the random seed. These are counts of strategies, not results of trading them.
- 1,583–1,694Strategies tried
- 690–871Passed the training period
- 3–5Passed every check
In all 10 runs the Miner tried 1,583 to 1,694 different strategies. 690 to 871 of them passed the training period, and 3 to 5 passed every check. The Miner stops listing at 5, so 5 means "5 or more".
All 10 runs
| Run (seed) | Strategies tried | Passed the training period | Passed every check |
|---|---|---|---|
| 1 | 1,634 | 743 | 5 |
| 2 | 1,631 | 788 | 3 |
| 3 | 1,691 | 793 | 4 |
| 4 | 1,583 | 690 | 4 |
| 5 | 1,665 | 801 | 5 |
| 6 | 1,694 | 871 | 4 |
| 7 | 1,600 | 781 | 5 |
| 8 | 1,631 | 762 | 3 |
| 9 | 1,657 | 810 | 5 |
| 10 | 1,680 | 806 | 5 |
- Settings
- H1 bars, 4 years of history, 2,000 trials, up to 5 strategies shown, at least 60 trades
- Price data
- Dukascopy hourly bars, 2022-10-16 to 2026-10-14
- Measured
- 2026-11-01
Passing the checks means a strategy held up on past prices. It does not say anything certain about the future, and we do not publish how these strategies traded.
The checks a strategy has to pass
Training and later period: the rules are fitted on the first part of the history and must hold on the part they have not seen.
Duplicates removed: strategies that enter on nearly the same bars count once.
Stress tests (shaken parameters, reordered trades, wider spread, year-by-year stability).
A final robustness re-check.
From a search to an MT5 EA
- 1
Open the Miner on XAUUSD and press Start mining. Gold is an add-on symbol, so the first run downloads its price history to your browser (Pro).
- 2
Read the strategies that survived. The conditions are shown with Pro.
- 3
Open one in the Strategy Builder (Pro), change anything you like and run a backtest.
- 4
Export the .mq5 source (Pro), open it in MetaEditor and compile it with F7.
- 5
Test it in the MT5 Strategy Tester on your own broker's gold data and spread, then on a demo account.
Your broker's gold spread, swap and trading hours differ from the research data. Test with your broker's own numbers before you trust any strategy.
Questions
Can I build a gold EA without writing code?
Yes. The Strategy Miner searches for gold strategies and the Strategy Builder lets you change them on a canvas of blocks. The MT5 source is exported with Pro and compiled by you in MetaEditor, so you do not write MQL5 yourself.
Do I need Pro to search gold?
Yes. XAUUSD is an add-on symbol, and add-on symbols, seeing the conditions of a strategy, opening it in the Builder and exporting are Pro features. Without Pro the Miner runs a small trial on the built-in currency pairs.
Does a strategy that passed the checks make money?
Nobody can promise that, and we do not. The checks remove strategies that fall apart on a second period or under stress. A strategy can pass them and still lose later. Backtest it on your broker's data and run it on a demo account first.
Why does gold start with a 60-pip spread?
Because that is what gold costs. A pip on gold is 0.01, and the median bid-ask spread in Dukascopy tick data is about $0.60. Testing gold at a forex spread of 1 pip would make every strategy look cheaper to trade than it is. You can change the spread before you search.
Which price data does the Miner use?
Dukascopy hourly bars that ship with the site, not your broker's feed. Your broker's prices will differ, so expect different numbers in MetaTrader 5.
This page is not trading advice. Backtests use past prices and approximate fills.
Make a gold (XAUUSD) EA with the Strategy Miner
Open the Miner on XAUUSD (Pro)
XAU/USD guide: how gold behaves and what a gold EA needs · Docs: how the Miner's checks work · Pro plan