XAUUSD EA for MT5: Setup and Settings Explained
Installing an XAUUSD Expert Advisor (EA) on MT5 takes a few minutes. Setting it up correctly takes a little more care, because a wrong setting can turn a careful bot into a risky one. This guide explains the settings you will meet in most gold EAs, what each one does, and the checks to run before you let the EA trade real money.
Before You Start
You need three things:
- An MT5 account with XAUUSD, on a demo account first if you are testing.
- The EA file (an .ex5 file) from the seller.
- A computer or VPS that stays on, because the EA only works while MT5 is running.
If you have never installed an EA, follow our step-by-step guide on how to install an Expert Advisor on MT5 first, then come back here for the settings.
Attach the EA to the Right Chart
Open an XAUUSD chart and drag the EA onto it. Two things often go wrong here:
- The symbol name. Many brokers add a suffix, such as XAUUSD.m, XAUUSD.s or GOLD. The EA must run on the symbol your broker actually uses for gold. If it is on the wrong chart, it will not trade.
- The timeframe. Some EAs need a specific chart timeframe. Use the one the seller tells you, even if the EA reads other timeframes itself.
Then turn on Algo Trading in the MT5 toolbar and tick Allow Algo Trading in the EA's settings window. A small hat or robot icon in the chart corner shows the EA is active.
The Settings That Matter Most
Every EA has its own list, but most gold EAs have these:
| Setting | What it controls | What to check |
|---|---|---|
| Risk per trade (%) | How much of the balance one trade can lose | Use the level the EA was tested at |
| Fixed lot | A set lot size instead of a percentage | Must suit your balance |
| Stop loss | Where a losing trade closes | Should be on every trade |
| Take profit | Where a winning trade closes | Fixed or trailing |
| Max spread | The widest spread the EA will trade at | Not too tight for your broker |
| News filter | Pauses trading around major news | On, unless told otherwise |
| Trading hours | When the EA may open trades | Matches your broker's server time |
| Magic number | Identifies the EA's own trades | Unique if you run several EAs |
Risk Per Trade: The Most Important Setting
Risk per trade decides how much one losing trade costs. At 1% risk on a $1,000 account, a losing trade costs about $10. At 5%, it costs about $50, and a run of losses can quickly cut the account by a third.
Start at the risk level the EA's backtests and live accounts used. If the results were made at 1%, running at 3% does not just triple the profit, it also triples the drawdown. Our post on what drawdown is explains why this matters.
Lot Size and Account Type
On a dollar account, 0.01 lot of gold is 1 ounce. On a cent account, the same 0.01 lot is worth 100 times less in dollar terms, so you can trade real money at a much smaller size. If your balance is small, a cent account gives the EA room to work. Our XAUUSD lot size guide and gold lot size calculator help you check the numbers.
Spread and News Settings
Gold spreads widen at the daily open, around big news and on thin holiday days. A max spread setting stops the EA from entering when the spread is too wide. Set it too tight and the EA may never trade on your broker; set it too wide and it may enter at a bad price.
A news filter pauses new trades around major US data. Leave it on unless the EA's documentation says otherwise. See how the news filter protects your account.
Five Checks Before Going Live
- Run it on a demo account first for at least a week.
- Check that every trade has a stop loss in the Trade tab.
- Compare the lot sizes with what you expected for your balance and risk.
- Check the Journal and Experts tabs for errors, such as "invalid volume" or "trade disabled".
- Move to a VPS so the EA keeps running 24/5. See how to set up a VPS for MT5.
Set Files: Saving Your Settings
A set file (.set) stores all the EA's settings in one file, so you can load them again in one click. Some sellers give you set files for different risk levels. Keep a copy of the set file you use, and note the date you changed anything. Our post on choosing your set file explains how we handle this for BZ Cent Machine.
How We Handle Setup
With BZ Dollar Machine and BZ Cent Machine, you do not have to guess any of this. We install the bot with you on a live call, set the risk you agree to, and check that the first trades open correctly. To compare gold EAs before choosing one, read how to choose the best gold trading bot.
Frequently Asked Questions
Why is my XAUUSD EA not trading?
The most common reasons are Algo Trading turned off, the EA on the wrong symbol name, a max spread setting that is too tight, or the market being closed.
What risk should I use?
Start with the risk level the EA was tested at. For our bots, that is 1% per trade.
Can I run two EAs on the same account?
Yes, if each one has a different magic number and your balance can carry the combined risk.
Do I need a VPS?
It is not required, but it keeps the EA running when your computer is off, and it usually gives faster execution.
Risk warning: trading gold (XAUUSD) on margin is high risk and you can lose some or all of your deposit. Backtest results are not live results, and past performance does not guarantee future results. This article is general information, not investment advice.



