Solutions Discover eTrader Launch your Broker Launch your Prop Firm Company Home Blog Where We Work Legal Center Contact
Platforms & White-Label

MQL4 vs MQL5: What Changed for Robot Developers.

MQL4 and MQL5 are MetaQuotes' own two languages, and the gap between them is no longer just syntax: new MT4 server licences are largely unavailable, which changes where new development belongs.

By September 19, 2026 9 min read

MetaQuotes has stopped issuing new MetaTrader 4 server licences to new customers, and has said in its own community forums that it does not expect further development to come out of MT4. Any firm asking which language to build in today is really asking a narrower question than it looks: not whether MQL4 is technically worse than MQL5, but whether it still makes sense to invest new development time in a platform MetaQuotes itself has moved past.

This is a comparison between MetaQuotes' own two languages, MQL4 for MetaTrader 4 and MQL5 for MetaTrader 5, for a developer or firm deciding where to put new robot development. It is not a comparison against eTrader or any other platform; that question gets a brief mention near the end.

A short timeline

MetaTrader 4 launched in 2005 with MQL4 as its language. MetaTrader 5 followed in 2010 with MQL5, a substantially reworked language built for the newer platform. For years the two ran in parallel, with MQL4 kept alive largely for firms and traders already committed to MT4's installed base of robots and indicators. MetaQuotes later updated MQL4 itself to share more of MQL5's underlying architecture, but the two remain distinct languages with real differences in what they support.

Procedural versus object-oriented

MQL4 is written mostly in a procedural style: functions that call other functions, with data passed between them directly. It does support a basic level of object-oriented programming, simple classes and objects, but the language was not built around OOP the way MQL5 was. MetaQuotes' own documentation for MQL5 describes a fully object-oriented language: encapsulation, inheritance, polymorphism, function and class templates, and the new and delete operators for managing objects directly. Trade execution in MQL5 typically goes through the CTrade class, an object-oriented wrapper that handles order and position management with built-in error handling, in place of MQL4's more direct OrderSend() style calls.

For a developer, this shows up most clearly on larger projects. A big MQL5 codebase can lean on inheritance and templates to avoid repeating the same logic across several robots or indicators. An equivalent MQL4 codebase tends to repeat more, or route everything through shared functions rather than shared class hierarchies. For a small, single-purpose robot, the difference matters less: both languages can express simple entry and exit logic without much ceremony either way.

What the platforms add on top of the language

Some of the practical difference between MQL4 and MQL5 development comes from what MetaTrader 5 itself adds, not the language syntax alone. MT5 supports both hedging and netting account modes, where MT4 supports hedging only, which changes how a robot needs to think about multiple open positions on the same instrument under netting rules. MT5 also adds a depth of market view and more built-in timeframes than MT4 offers, both of which a robot can read and react to through the API, and MT5's Strategy Tester is multi-threaded, letting a developer run large batches of parameter combinations across available CPU cores rather than one after another.

AspectMQL4 (MetaTrader 4)MQL5 (MetaTrader 5)
Launched20052010
Programming styleMostly procedural, limited OOPFully object-oriented: inheritance, polymorphism, templates
Trade executionDirect OrderSend() style callsCTrade class with built-in error handling
Account modesHedging onlyHedging and netting
Depth of marketNot availableAvailable
Strategy TesterSingle-threadedMulti-threaded, runs parameter sweeps in parallel
New server licences from MetaQuotesLargely unavailable to new customersThe platform MetaQuotes is steering new development toward

The library question

Both languages sit inside the same MQL5.community and MQL5 Market ecosystem, so a developer working in either one has access to a genuinely large body of documentation, forum discussion and purchasable code. MQL5's share of new activity has grown as more brokers and firms open MT5 servers, simply because that is where new licensing has gone. A developer choosing MQL4 today is choosing a smaller, more static pool of ongoing community activity than a developer choosing MQL5, even though MQL4's existing library, built up since 2005, remains large in absolute terms.

Why new development is steered toward MQL5

The language differences matter less to most firms today than the licensing reality behind them. MetaQuotes has made new MT4 server licences largely unavailable to new customers, while continuing to develop and issue MT5 licences, which means a firm setting up a new server today is generally pointed toward MT5 regardless of which language its developers know best. A firm that already runs MT4 and has years of MQL4 robots built up faces a different calculation: rewriting that code in MQL5 is real work, and plenty of firms keep an existing MT4 server running for as long as MetaQuotes continues to support it, while building anything new on MT5.

For a developer starting from nothing, the practical answer follows from the licensing picture rather than a pure language preference: build in MQL5, on MT5, because that is where new licences and new platform development are both going. Read more on the general approach to building and testing a robot in algorithmic trading basics and backtest overfitting, and see MetaQuotes' own MQL5 documentation on object-oriented programming for the language details in full.

A third option some firms evaluate alongside MQL4/5

Firms deciding where to put new automated trading development sometimes weigh a third option alongside MQL4 and MQL5: eTrader Code, which uses Tide, a language SGHK built specifically for automated trading. Tide robots run in eTrader's own cloud rather than a rented VPS or a terminal that must stay open, and its type system separates price and lots as distinct types, which MQL4 and MQL5 do not do. It is a genuinely different platform and language, not a drop-in replacement for either MQL4 or MQL5, and a robot moving from MQL4 or MQL5 to Tide has to be rewritten by hand rather than converted automatically. See Tide vs MQL5 for that comparison in full.

"MQL4 and MQL5 are not really competing languages anymore. MetaQuotes has told the market where new development is going, and that decision matters more than any syntax difference."

— The SGHK Team

Key Takeaways

Frequently Asked Questions

Is MQL5 harder to learn than MQL4?

MQL5 has a larger feature set because it is fully object-oriented, so there is more to learn if a developer wants to use classes, inheritance and templates well. For simple robots that do not need that structure, MQL5's basic syntax is not dramatically harder than MQL4's.

Can an MQL4 Expert Advisor run unchanged on MetaTrader 5?

No. MQL4 and MQL5 are distinct languages with different compilers, and an Expert Advisor written for MT4 needs to be ported to MQL5 to run on MT5. The underlying trading logic often carries over reasonably well, but the code itself has to be rewritten against MQL5's syntax and API, including its CTrade class for trade execution.

Why would a firm still use MQL4 today?

Mainly because it already runs an MT4 server with an established base of traders and MQL4 robots, and rewriting all of that in MQL5 is real work with no guarantee of matching behavior exactly. New MT4 server licences from MetaQuotes are largely unavailable to new customers, so this is generally a reason to maintain an existing MT4 server, not to start a new one.

Does MQL5 support more account types than MQL4?

Yes. MetaTrader 5 supports both hedging and netting account modes, while MetaTrader 4 supports hedging only. A robot written for MQL5 needs to account for which mode the account uses, since netting changes how multiple positions on the same instrument are represented.

Is eTrader's Tide language a replacement for MQL4 or MQL5?

Not a drop-in one. Tide is a separate language built for eTrader, with its own type system and cloud-hosted robots, and firms weighing it alongside MQL4 and MQL5 should expect to rewrite any existing robot by hand rather than convert it automatically.


About SGHK

SGHK is a FinTech company that designs and builds its own software for the trading industry: the eTrader trading platform, Launch your Broker and Launch your Prop Firm. Every product is written, hosted and supported in-house and licensed to trading firms, with the CRMs branded to them, all hosted by us in the cloud, managed by each firm and built to scale across clustered servers as our clients grow. Everything is encrypted, and each firm is the only one with access to its data and its clients' data.

Your Own Trading Firm, Live in 24 Hours.

SGHK builds the technology behind brokers and prop firms: trading platform, CRM, client portal and payment rails, one bundle, one vendor. Book a call and see it working, or keep reading the guides.

More in Platforms & White-Label