How to split your EAs by magic number (and what you'll find)
Published on
If you run three, five or ten EAs on the same MT4 or MT5 account, the equity curve in your terminal doesn't belong to any of them. It's an average. And averages hide things: a good EA can cover for a broken one for months, and an account that "is doing fine" may depend on a single system without you knowing it.
The fix is simple, and few traders apply it consistently: split your history by magic number and look at each EA on its own. This guide covers how to do it properly and what usually shows up the first time you do.
What a magic number is and why it matters
Every order an EA sends carries a numeric ID: the magic number. The EA sets it, usually from an input parameter (MagicNumber, Magic, ID… every developer names it differently). MetaTrader stores it on every trade, in both MT4 and MT5, and the EA uses it to recognise its own positions and leave everyone else's alone.
Trades you open by hand carry magic number 0. So in any per-EA analysis, magic 0 means "manual" (or a misconfigured EA, which also happens).
For you, the magic number is the label that answers the question that matters: what has each system actually done?
How to assign numbers without making a mess
A few rules prevent almost every problem:
- One number per EA. If two EAs share a number, their trades get mixed and no analysis can separate them later.
- One number per copy with different settings. The same EA on EURUSD with one risk level and on GBPUSD with another are, for analysis purposes, two systems. If you want to compare settings, each needs its own number.
- Use a scheme you can read. For example, the first digits for the EA and the last ones for the variant: 7701, 7702, 7703 for three settings of the same system. (Just an example; any scheme you'll still understand in six months works.)
- Write the list down. A sheet with "number → EA, symbol, settings, start date" saves a lot of guesswork.
- Don't change the number with open positions. Many EAs only manage orders with their current number: change it mid-trade and the position can be orphaned, with no exit or trailing stop. Change it when the EA is flat.
Two cases worth checking:
- EAs that don't let you choose the number. Some have it hard-coded. Two copies of such an EA on the same account share a number, and you can't separate them by magic. Ask the vendor, or separate them by account or by symbol.
- EAs that use several numbers. Some systems assign a different number per symbol or per entry type. That's fine, but you need to know so you can group them back as one EA.
What to check for each EA
Once the history is split, don't stop at profit. For each magic number, look at least at:
- Trades and last trade. Is it still trading? At the expected pace?
- Net result including commissions and swaps, not just gross.
- Profit factor (gross profit divided by gross loss) and win rate, together: either one alone is misleading.
- Expectancy per trade: what an average trade makes or loses.
- Max drawdown of the EA itself, not of the account.
- Longest losing streaks.
One technical detail that matters: if an EA closes positions in parts (partial closes), count the position as one trade. Otherwise the trade count and win rate come out inflated.
What usually shows up the first time
This is what tends to come out when someone splits their EAs for the first time. These aren't statistics, just common patterns:
- An EA that stopped and nobody noticed. The terminal restarted, the EA fell off the chart, or the broker renamed the symbol. The account kept moving thanks to the others. Checking each EA's last trade date catches this in seconds.
- One EA carrying the whole account. Hypothetical example: five EAs, the account is up, but once split, one explains nearly all the profit and the other four add up to zero or lose. Your "portfolio" is really one system with four passengers.
- A drawdown well beyond the backtest. You don't see it at account level because other EAs compensate, but that particular system has already fallen further than its backtest made plausible.
- Two EAs doing the same thing. If two systems win and lose on the same days, you aren't diversified: you hold one bet at double size. The correlation of their daily results gives it away.
- Costs eating a system. An EA with many small trades can be profitable gross and lose money once commissions and swaps are added.
By hand or automatically
You can do this in a spreadsheet: export your MetaTrader history, filter by magic number and calculate each metric. It works, but you have to repeat it every week, and it's hard to spot in time that an EA has stopped.
That's what TrendPax's TRACKING does continuously. A small read-only EA, the publisher, sends your MT4 or MT5 account history; the web groups trades by magic number and every EA gets its own row in the "By EA" table, its own page, a comparison with its backtest if you upload one, and a warning when two EAs move almost identically (on the "Compare EAs" screen).
If you'd like to see it with made-up data before connecting anything, the demo needs no sign-up: trendpax.com/en/tracking/demo/eas. If it's useful to you, creating an account and your dashboard is free.
Risk warning. This article is educational and is not investment advice. Trading forex, CFDs and other leveraged products carries a high risk of loss and may not be suitable for everyone. Past results, live or backtested, do not guarantee future results.