Magic number
A magic number is a numerical identifier an EA assigns to its orders to distinguish them from other EAs' trades and manual trades.
What goes wrong without one
An EA that loops through all positions indiscriminately will manage other trades: moving stops on your manual trades and closing another robot's positions.
If two EAs on one account share the same magic number, each treats the other's positions as its own. The result is mutual trade closures and chaotic statistics.
How to assign one
Use a different number for every EA and every pair it runs on. A convenient scheme is a number such as 20260815, or a combination of a strategy code and an instrument code.
Common mistakes
- •Leaving the default value on several copies of the same EA.
- •Changing the magic number while positions are open: the robot will stop recognizing them.
FAQ
What happens if two EAs have the same magic number?
Each starts managing the other's positions: monitoring them, moving stops and closing them. On the account, this appears as unpredictable behavior by both robots.
Does the magic number affect trading?
No, it is only a label on an order. It does not affect execution, spread or the result.
Related terms
See it on live data
Profit factor, drawdown and win rate of the expert advisors in our catalog are shown in the EA rating — these are demo accounts whose results cannot be edited after the fact. The robots themselves are in the free expert advisor catalog.