Advertisement IC Markets

Version control for EAs: a simple setup

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: 976
Joined: Sun Oct 18, 2026 12:25 pm

Version control for EAs: a simple setup

Post by FXS London Scalper »

EA code changes over time, and without version control it's hard to know which version made which trades. A simple setup helps.

Basics:
  • A git repository for the MQL5 folder, or at least the Experts and Include folders.
  • Commit every change with a short message.
  • Tag versions deployed to live, for example v1.4-live.
Linking versions to trades:
  • Put the version number in the EA's input parameters or in a constant, and write it into the trade comment or log.
  • Keep a short changelog: what changed and why.
Why it matters: if results change, you can see whether the code changed at the same time. Without that link, it's easy to blame the market for a bug.

Practical tip: don't commit compiled ex5 files unless needed, and never commit account passwords or API keys in input files.

A private repository is enough; nothing about version control requires sharing code publicly.

How do you keep track of EA versions?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Amanhasnoname
Posts: 2060
Joined: Fri Oct 30, 2026 9:45 am

Re: Version control for EAs: a simple setup

Post by Amanhasnoname »

I started using git after a week I could not explain. Results had turned without any obvious change in the market, and I had no record of which build of the expert advisor was attached. I now keep a private repository of the Experts and Include folders only, commit every change I might actually attach, and tag whatever goes onto the live account, for example live-2026-03-12.

The version string sits in an input and is written into the trade comment, so each ticket carries something like fade-v1.7.3. There is also a one-page changelog in the same repository. That is how I caught the April problem: git showed I had pushed a stop-calculation change the Sunday before, and the forty-one trades that week were the new code. Expectancy went from plus fourteen hundredths of R to minus nine. It was not the market.

I never commit compiled files, and I never commit set files that hold a login or a key. The repository lives on a machine that does not send orders. When I deploy, I pull that tagged commit to the VPS.
Post Reply