Same EA, different set files on one MT5 account: how to tell them apart
Short answer: MT5 doesn't know what a set file is. A set file only fills in the EA's inputs, and the trades it produces carry no trace of which file you loaded. To tell the runs apart, each chart needs its own magic number, set in the inputs. A comment label helps you read the trades, but the magic number is the ID.
This guide covers how to set that up, what MT5 shows afterwards, and how to see which set file is carrying the account's drawdown.
What a set file does and doesn't do
A set file (.set) is a saved list of an EA's input values. In the EA's Inputs tab, Save writes the current values to a file and Load reads one back. The MetaTrader 5 help says these files "can be moved between platforms on different computers or sent to other users".
Loading a set file onto a chart changes the inputs of that one EA instance. The terminal keeps no record of which file you used, and nothing in an order, position or deal says "set file A". If two charts run the same EA with different set files and the same magic number, their trades land in one pile.
Give each set file its own magic number
The magic number is the ID an EA attaches to its orders. The MetaTrader 5 help describes it as "the value specified by a trading robot when opening orders and positions (Expert Advisor ID)". Most EAs expose it as an input (often MagicNumber or Magic), which means it can live inside the set file.
- Put a different magic number in every set file. Open the Inputs tab, change the magic, click Save, and name the file after the run:
trend-eurusd-1101.set. - Load one file per chart. One chart, one EA instance, one set file.
- Write the mapping down. "1101 = trend, EURUSD, conservative. 1102 = trend, EURUSD, aggressive."
- Set the magic before the first trade. A position keeps the magic it opened with. If you change the input afterwards, the old positions keep the old number and the EA may stop managing them.
If the EA has no magic input and uses a fixed number, two instances will treat each other's trades as their own. Check the vendor's manual before you run a second copy.
If the same set file goes on two charts, such as the same strategy on EURUSD and GBPUSD, you decide whether they share a magic. A shared magic gives you one combined result. Separate magics let you compare them. Pick separate unless you have a reason not to.
Use the comment as a label, not an ID
Many EAs also have a comment input. Put a short name in it, such as trend-aggr. The comment shows in the list of open positions and in the history, so you can read your trades without a lookup table.
Don't rely on it as the ID:
- Length. The MT5 help says the maximum comment length is 31 characters.
- Brokers can change it. The same page says that "a comment to an order can be changed by a broker or server". For example, when a position closes on Stop Loss or Take Profit, that information is shown in the comment. See why the comment changes on closed trades.
- Nothing makes it unique. Two instances can carry the same text by accident.
Check the account type
Several set files of one EA on the same symbol need a hedging account. The MT5 help describes netting as "for one financial instrument only one position can exist at any given time" and hedging as allowing several positions on one instrument at once. On netting, two set files trading EURUSD share one position, whatever magic numbers they use. The details are in two EAs on the same symbol.
What MT5 shows once they're separate
MT5's History tab has a magic column, so you can tell which set file opened a closed trade. You can total closed profit per magic number from there or with a short script. That gives you profit per set file. For the tab and the script, see drawdown per EA by magic number.
It doesn't give you drawdown. A closed trade records where it ended, not how far it went against you on the way. Two set files of one EA can have similar closed results, while one of them sits far deeper underwater on the way there, for example because it uses a wider grid step or larger lots.
Compare set files by drawdown, not just profit
With DrawGuard, you attach its free EA to one chart on the account. Every 60 seconds it sends the account's equity and every open position, with its symbol, magic number, comment and floating profit, to a web dashboard. Because each set file has its own magic number, you can:
- Filter the equity and drawdown charts to one magic number, or a few.
- Open any day, week or month and see its drawdown split by symbol, magic number and comment, so you can see which set file caused it.
- Compare the conservative and aggressive set on the same days, on the same account.
Limits: DrawGuard monitors and warns; it never places, modifies or closes trades, and it can't change a set file's inputs. Data starts when the EA connects. Closed trade history can be imported, but floating drawdown from before can't be recovered. It is MetaTrader 5 only. Alerts by email are on paid plans, and there is a free plan for one account.
Because the account's drawdown limit covers all the set files together, also look at the combined drawdown.
Each set file also needs its own chart; here is how to run multiple EAs on one MT5 account.
A checklist for running several set files
- Confirm the account is hedging.
- One chart per set file, with a unique magic number inside the file.
- Name each file after its magic and its job, and keep a list.
- Add a short comment label for readability.
- Compare set files on drawdown as well as profit, over the same days.
FAQ
Does MT5 record which set file a trade came from?
No. A set file only fills in inputs. The only trace in the trade is whatever the inputs contain, such as the magic number and the comment.
Can I run the same EA twice with different set files on one account?
Yes, on a hedging account, with one set file per chart and a different magic number in each. If the EA has no magic input, the two copies will treat each other's trades as their own.
Should each set file have its own magic number?
Yes, if you want to compare them. The magic number is the ID that separates trades in MT5's History tab and in any tool built on it.
Can I rely on the trade comment to separate set files?
Use it as a label only. It is capped at 31 characters and a broker or server can change it, for example when a position closes on Stop Loss or Take Profit.