Home > Blog > XAUUSD EA Settings Guide — Optimal Parameters for Gold Trading in 2026

XAUUSDEA SettingsGold EAMT5Risk Management

XAUUSD EA Settings Guide — Optimal Parameters for Gold Trading in 2026

Published: 2026-05-22Read time: about 3 min

XAUUSD EA Settings Guide — Optimal Parameters for Gold Trading

One of the most common questions from new EA traders: "What settings should I use?" The wrong answer is to copy someone else's parameters blindly. The right answer is to understand what each parameter does so you can adapt it to your account size, risk tolerance, and broker.

This guide covers the essential parameters for any XAUUSD Expert Advisor and the reasoning behind recommended defaults.


1. RiskPercent — The Most Important Setting

What it does: Controls what percentage of your account balance is risked on each trade.

Most professional EA traders use 0.5–1.0% per trade. Here's why:

At 1% risk per trade, a 10-trade losing streak (which happens even with good EAs) costs you approximately 10% of your account. At 2%, the same losing streak costs ~20%. At 5%, it's nearly 50%.

The math of recovery also matters: losing 20% requires a 25% gain to recover. Losing 50% requires a 100% gain.

Recommended settings by account size:

Account SizeStarting RiskPercentNotes
$500–$2,0000.5%Small account needs conservative risk
$2,000–$10,0001.0%Standard recommendation
$10,000+0.5–1.0%Experienced traders may use 1.5–2.0%

For XAUUSD specifically, start at 0.5% if you're new to gold EAs. Gold moves 200–500 pips on active days — 1% risk at high volatility can still feel sharp.


2. MaxSpread — Protecting Against Broker Tricks

What it does: If the current spread exceeds this value, the EA skips the entry signal.

XAUUSD spreads vary from 1.5 pips (ECN accounts during London hours) to 8+ pips (standard accounts during Asian session or news events). An EA that enters at a 7-pip spread immediately has a 7-pip disadvantage — on a 20-pip target, that's 35% of your potential profit gone before the trade begins.

Recommended settings:

Account TypeMaxSpread Setting
ECN/RAW account2.5–3.0 pips
Standard account4.0–5.0 pips
During news eventsLet the filter skip

Set MaxSpread conservatively. It's better to miss a few entries than to enter during wide-spread conditions.

How to find your actual live spread: In MT5, watch the bid/ask column in Market Watch during the hours you plan to trade. Note the spread during normal conditions and during news events.


3. Stop Loss Configuration — Fixed vs ATR-Based

Most quality gold EAs use one of two stop-loss approaches:

Fixed Pip Stop

Simple and predictable. Example: SL = 50 pips, TP = 75 pips (R:R = 1:1.5).

Pro: Easy to understand, consistent behavior. Con: Doesn't adapt to market volatility — a 50-pip stop is too tight during a volatile NFP week and too wide during quiet Asian sessions.

ATR-Based Stop

Stop loss = N × ATR (Average True Range). Example: SL = 1.5 × ATR(14).

Pro: Adapts automatically to current volatility. When gold is calm, the stop is tighter. When volatile, wider. Con: Lot size calculation is more complex; beginners may miscalculate.

Recommendation: For XAUUSD, ATR-based stops generally perform better in backtests because gold volatility is highly variable. Our GOLD EMA ATR EA uses SL = 1.5 × ATR(14) and TP = 2.0 × ATR(14) by default.


4. MagicNumber — Avoid Conflicts Between EAs

What it does: A unique number that identifies your EA's trades. The EA only manages positions with its own Magic Number.

If you run two EAs with the same Magic Number, they will interfere with each other — each will try to manage the other's trades, leading to unpredictable closes, double entries, or missed exits.

Rule: Every EA must have a unique Magic Number. If you run GOLD EMA ATR EA alongside another EA, make sure they have different numbers.

Default Magic Numbers in fxea365.com EAs are pre-set to unique values. Don't change them unless you have a specific reason.


5. UseCompounding — Compound vs Fixed Balance

What it does:

  • true (default): Lot size scales with your account balance as it grows or shrinks
  • false: Lot size always calculated on a fixed balance value

Compounding example: Start with $10,000, 1% risk. After growing to $15,000, the EA automatically trades with larger lots. This is the "compound interest" effect — your returns compound.

Fixed balance example: Always calculate lots as if balance is $10,000, regardless of actual balance. More predictable; you know exactly how much is risked each trade.

Recommendation: UseCompounding = true for long-term growth. UseCompounding = false for more predictable short-term testing.


6. Time Filter Settings

As covered in our XAUUSD trading hours guide, the best hours for gold EA trading are 07:00–17:00 UTC (London open to end of London-NY overlap).

UseTimeFilter    = true
TradeStartHour   = 7
TradeEndHour     = 17
AvoidFridayClose = true   (stop new entries after 20:00 UTC Friday)

Note: Broker server time ≠ UTC. Check your broker's GMT offset in the MT5 Market Watch — it's shown at the bottom. XM server is typically GMT+2 (or GMT+3 in summer). Adjust your filter hours accordingly.


7. Economic Filter Settings

For XAUUSD, major US news events (NFP, CPI, FOMC) can cause 100–300 pip moves in minutes. An EA can easily open a losing trade seconds before a surprise announcement.

UseEconomicFilter     = true
NewsAvoidMinutesBefore = 30
NewsAvoidMinutesAfter  = 30
NewsImpactLevel       = 2   (filter medium and high impact news)
NewsTargetCurrencies  = "USD"

This pauses new trade entries 30 minutes before and after any medium or high impact USD news event.


For a new live account using the GOLD EMA ATR EA:

ParameterRecommended ValueNotes
RiskPercent0.5%Start conservative
MaxSpread3.0 pipsAdjust based on your broker
UseCompoundingtrueFor long-term growth
UseTimeFiltertrue07:00–17:00 UTC
UseEconomicFiltertrueSkip major news
MagicNumber(default)Don't change unless running multiple EAs

After 2–4 weeks of live observation at 0.5% risk, you can increase to 1.0% if results match expectations.


Download the GOLD EMA ATR EA free and apply these settings from day one. All parameters are accessible directly from the EA's settings dialog in MT5.

5-Day Email Course (Free)

Get one email a day covering the essentials of FX automated trading, how to read backtests correctly, and tips for choosing a broker.

* Privacy strictly protected. You can unsubscribe at any time.