Skip to content
XauStack

More than one gold EA on one MT5 account

Updated6 min read

MetaTrader 5RiskXAUUSD

You can run a second gold EA on the same account if each has its own chart and magic number and the account is hedging, but both draw on one margin and one stop-out level.

  • Each EA needs its own chart and its own magic number. On a netting account even that is not enough: there is one XAUUSD position to share.
  • Margin, margin level and the stop-out level belong to the account, not to either EA.
  • Two gold EAs are two bets on one instrument. Size the account for both of their worst stretches arriving together.

Running a second Expert Advisor on the same account looks like a settings question: another chart, another number, done. On gold it is mostly a risk question, because both EAs trade the one instrument and draw on the one margin. This page runs through what MetaTrader 5 separates for you, what it does not, and what to check before the second EA goes live.

One chart each, one magic number each

MetaTrader 5 does not let two EAs share a chart: “Only one Expert Advisor can run on one chart. If you start another Expert Advisor on the same chart, the first one is removed” (MetaTrader 5 Help). Open a second XAUUSD chart and attach the second EA there.

The chart keeps them apart while they decide. Once an order is placed, what keeps them apart is the magic number. MQL5’s reference defines it as the “ID of an Expert Advisor that has placed the order (designed to ensure that each Expert Advisor places its own unique number)”, and every position carries it (MQL5 order properties, position properties). An EA that manages “its” positions by symbol and magic number will take another EA’s positions for its own if the two numbers match. One that checks only the symbol will do so whatever the numbers are, so ask a seller which kind theirs is.

The same applies to one EA on two charts: two copies with one magic number are two programs arguing over the same positions. Each of our builds carries its own magic number, which is how MetaTrader 5 tells its positions from another EA’s, and a magic-number input is one of the four it exposes.

A netting account has one gold position

The account’s position accounting decides whether magic numbers can help at all. MQL5 describes netting as the mode where “only one position can exist for one symbol”, and hedging as the one where “multiple positions can exist for one symbol” (MQL5 account properties). On netting, a deal in the opposite direction reduces, closes or reverses the existing position, and “it does not matter, what has caused the opposite deal” (MetaTrader 5 release notes).

Illustration, not taken from any run: on a netting account, EA A buys 0.10 lots of XAUUSD. An hour later EA B sells 0.10 lots. The account now holds no gold position at all, and neither EA has the trade it thinks it has.

MetaTrader 5 shows the system on the window header and in the Journal, so check it before attaching a second gold EA. Each of our Products states what it needs on its page: four ask for a hedging account, Reclaim and Dawnbreak run on netting or hedging, and Dawnbreak adds “One robot per account — nothing else trading gold”. Where a seller says nothing, ask before you combine.

One margin, one stop out

On a hedging account the positions stay separate, but their margin does not. MetaTrader 5 adds positions in the same direction together: “Their volumes are summed up and the weighted average open price is calculated for them”. Opposite positions are “considered hedged or covered”, and what the covered part costs depends on the “Hedged margin” field of the symbol’s contract specification (MetaTrader 5 Help). That field is your broker’s, so read it in the Specification window.

Margin level and the stop-out level are properties of the account: ACCOUNT_MARGIN_LEVEL, “Account margin level in percents”, and ACCOUNT_MARGIN_SO_SO, “Margin stop out level” (MQL5 account properties). Neither belongs to an EA. When the account reaches its broker’s stop-out level, the positions it closes are the account’s, whichever EA opened them.

Two gold EAs are one bigger bet

Both EAs trade the same instrument, so on the days gold moves hard against one of them it may be moving against the other as well. When both hold a long, the account is simply longer gold.

Every Strategy Tester report you will see, ours included, shows one EA alone on its account. None shows what two of them do to each other. The arithmetic you can do yourself is a rough one: if each EA traded exactly as it did alone, the combined drawdown in dollars would be at most the two deepest drawdowns added together, reached when the two worst stretches coincide. On a shared account that premise can fail: an EA that sizes from equity sizes against the combined balance, positions merge on a netting account, and a stop-out closes both. Treat the sum as a floor for planning, not a ceiling, and plan the deposit for it, not for the larger of the two. Account size and drawdown shows how the same dollar loss reads at different deposits, and the lot-size calculator splits one risk budget into lots.

On a prop-firm evaluation this matters twice over: the daily and overall limits are measured on the account, so two EAs spend one allowance. The prop-firm guide covers how those limits are counted.

A short routine before the second EA goes live

  1. Read the account’s position accounting on the window header.
  2. Read each EA’s own requirements: account type, deposit, and whether it wants the account to itself.
  3. Give each EA its own chart and its own magic number.
  4. Backtest each one separately on your broker’s ticks, over the same window, at the deposit it will actually share, and add their deepest drawdowns in dollars.
  5. Compare that sum with your deposit and your broker’s stop-out level. If the sum does not fit, the pair does not fit.

The free Backtest Edition of each of our Products runs step 4 in your own Strategy Tester, with no email and no form.

Before you act on any of this

Every figure XauStack publishes comes from the MetaTrader 5 Strategy Tester, never from live trading, and no result is promised anywhere on this site. The lot sizes above are an illustration, not a setting. Trading gold on leverage carries a high risk of losing money rapidly: read the risk disclosure before you add a second EA to a funded account.

The strategies this guide covers

Each report is one Strategy Tester run over past prices — a simulation, not live trading.

All guides

Book a call