MT4 End-of-Life Now Comes With Dates — and Why "Just Recompile It" Fails on Netting Accounts

MT4 End-of-Life Now Comes With Dates — and Why "Just Recompile It" Fails on Netting Accounts

2 September 2026, 09:15
Boris Armenteros
0
41

The first published schedule

Until this year, MT4's end-of-life was a prediction. Now there is a broker with a published calendar: OANDA Japan stopped opening new MT4 accounts in March 2026, suspends new MT4 orders — demo and live — on September 25, and terminates MT4 service entirely on November 27 (reported by FX News Group). Their stated reason is the part worth reading twice: MetaQuotes no longer provides system maintenance for MT4, which makes it "difficult to continue meeting the latest security requirements."

Scope matters: that is one subsidiary, on its own servers, and no other broker has published dates. But the rationale is about the platform, not the servers — and it applies to every MT4 install, wherever it runs. They also stopped adding new markets to MT4 months before the shutdown: three commodity CFDs added in August 2026 are MT5-only, explicitly because MT4 is ending. If your broker's newest symbols skip MT4, you have seen this stage before.

So sooner or later, most of us with MQL4 code in production face the same question: how does it get to MT5?

Why the converter output misbehaves

The tempting answer is a syntax converter, and the problem with converters is precise: they translate syntax, and the platforms differ in architecture. The clearest example is position accounting. MQL4 has no positions — it has orders, one ticket per trade, so "how many trades do I have open?" is a loop:

// MQL4: one ticket per open trade
int CountOpenTrades(const string symbol, const int magic)
{
   int count = 0;
   for(int i = OrdersTotal() - 1; i >= 0; i--)
   {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { continue; }
      if(OrderSymbol() == symbol && OrderMagicNumber() == magic)
      {
         count++;
      }
   }
   return count;
}

A line-by-line translation to MQL5 compiles without a single warning:

// MQL5 "equivalent" — compiles cleanly, wrong on netting accounts
int CountOpenTrades(const string symbol, const long magic)
{
   int count = 0;
   for(int i = PositionsTotal() - 1; i >= 0; i--)
   {
      if(PositionGetSymbol(i) != symbol) { continue; }
      if(PositionGetInteger(POSITION_MAGIC) == magic)
      {
         count++;
      }
   }
   return count;
}

On a netting account, MT5 maintains at most one position per symbol. Three MT4 buy tickets become one aggregated MT5 position, so this function can only ever return 0 or 1 — and the position's magic number belongs to whichever deal last touched the net position. Any strategy that scales in, grids, or runs two EAs on one symbol has just had its core assumption deleted. Nothing fails loudly. The EA under-counts its exposure, skips entries it should take, or adds size it should not, and the backtest may even look plausible because the distortion is systematic.

Position accounting is only the most visible break. Order-send semantics differ (requests, deals, and orders are separate entities in MT5), event handling differs ( OnTradeTransaction  has no MQL4 ancestor), and partial fills surface in ways MQL4 code never had to consider.

What to audit before you migrate

Whether you do the port yourself or hand it to someone, the audit list is the same:

  • Every OrdersTotal()  / OrderSelect()  loop — decide what it should mean under netting, per symbol and per magic
  • Ticket-based state (trailing logic keyed to ticket numbers, recovery after restart) — MT5 position identifiers behave differently
  • Scale-in and hedge logic — on a netting account, an opposite-direction order reduces or reverses the position instead of opening a hedge
  • Anything that assumes an order's magic number survives — under netting it may not
  • A parallel test window — run the MT4 original and the MT5 port side by side on identical feeds until the trade lists match line for line

The published schedule is one broker's. The engineering reality is everyone's: a working MQL4 system gets to MT5 by re-implementation and verification, not by recompilation — and doing that calmly takes weeks, not days. Better to spend those weeks on your own calendar than on a broker's.