Advertisement IC Markets

Magic numbers and why I give every EA version its own range

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
FXS London Scalper
Posts: 806
Joined: Sun Oct 18, 2026 12:25 pm

Magic numbers and why I give every EA version its own range

Post by FXS London Scalper »

When I update an EA I now change its magic number, not only the version string. Each EA gets a block of numbers, for example 41000 to 41099 for my EURUSD breakout EA, and every new version takes the next number in the block.

Why it helped:
  • After an update, old open trades still belong to the old version. Without a separate magic number, the new code tried to manage positions it didn't open, with different stop logic. That happened to me once and it wasn't pretty.
  • Reporting by version becomes trivial. I can filter the account history by magic number and see how v2.3 did against v2.4 without guessing dates.
  • If I run the same EA on two charts with different settings, each chart gets its own number inside the block.
I keep a small text file listing every number, the version, the settings file and the date it went live. It's boring, but it's saved me from at least two confused reviews.

One thing to watch: some trade copiers and prop firm dashboards group by magic number, so changing it can look like a new strategy to them.

How do others handle versioning in live accounts? Separate numbers, comments on the order, or something else?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Post Reply