Home / Blog / MT4 or MT5 for an Expert Advisor: which to pick for a grid EA…

MT4 or MT5 for an Expert Advisor: which to pick for a grid EA on gold

For expert advisors in 2026, MT5 is the better choice: it tests on real broker ticks with every CPU core, can send orders as a batch, and offers hedging accounts, which grid EAs need. MT4 stays reasonable if your EA is already written in MQL4, your broker offers only MT4, or you want the simplest platform.

MT4 or MT5 for an EA: MT5 For EAs in 2026: real-tick tests, batch orders and hedging accounts
MT5 For EAs in 2026: real-tick tests, batch orders and hedging accounts

This is a comparison for people who run an Expert Advisor (EA, an automated trading program), not for those who trade by hand. The angle is a grid or martingale EA on gold (XAUUSD). Midas, the EA behind this site, runs on MT5 only.

On this page (10)

MT4 vs MT5 for an EA: comparison table

CriterionMT4MT5What it means for an EA
DevelopmentMetaQuotes said in January 2018 that new functions would be added only to MT5Actively developedMT5 gets the new tools; MT4 gets fixes
New broker licencesMetaQuotes stopped selling new MT4 licences in January 2018 (press report)New broker servers run MT5Fewer brokers will offer MT4 over time
EA languageMQL4MQL5The two are not compatible; an EA must be rewritten, not copied
Chart timeframes9 (MQL4 has 12 more constants, used mainly for offline charts)21MT5 offers M2, M3, H2, H12 and more; a one-minute EA needs only M1
Order types2 market + 4 pending2 market + 6 pending (adds Buy Stop Limit and Sell Stop Limit)Grids mostly use market and limit orders, so this rarely decides it
Position accountingEach order is its own positionNetting, exchange or hedging, set by the broker per account; hedging added on 1 April 2016A grid with a lock needs MT5 hedging
Testing models3: Every tick (modelled), Control points, Open prices only5, including Every tick based on real ticksMT5 can test on the broker's real ticks
Price historyStored history has Bid only; the tester models Ask with a spreadReal ticks with Bid and AskSpread in an MT4 test is an assumption
Tester speedThe official help describes no agents or cloudMulti-threaded, local and remote agents, MQL5 Cloud NetworkParameter sweeps finish faster on MT5
Sending ordersSynchronous OrderSendOrderSend and OrderSendAsyncA basket can be sent as a batch on MT5
Depth of MarketNot found in the official MT4 helpBuilt-in windowMatters for exchange-traded symbols, not for gold CFDs
64-bitInstallers are 64-bit only since late 2023 (press report)64-bit since build 292, July 2010No longer a real difference
Mobile appsBoth removed from the iOS App Store on 24 September 2022, back on 6 March 2023SameNot a differentiator
Ready-made EAsLarger library of older EAs and indicatorsSmaller, growingMT4 wins on the sheer number of old scripts
MidasNot supportedSupported on hedging cent accountsMidas needs MT5

Sources for each row are listed at the end. Where a row says "press report", MetaQuotes itself has not published a page we could cite.

Testing an EA: real ticks and many cores

A backtest is only as good as its tick data. MT4's own help says the price history stored in the terminal includes only Bid prices, and that the tester models Ask with the spread at the start of the test. Its "Every tick" model builds ticks from smaller timeframes by interpolation, and results from "Control points" are called estimates.

MT5's Strategy Tester has five modes: Every tick, Every tick based on real ticks, 1 minute OHLC, Open prices only and Math calculations. The real-ticks mode uses tick data accumulated by brokers, with no simulation. It is also multi-threaded: local agents work in parallel, remote agents can be added, and the MQL5 Cloud Network can take part of an optimisation.

For a grid EA that matters, because a basket lives or dies on fast moves inside a minute bar. Real ticks are closer to what happened. They are still the broker's feed, so a test is evidence about the past, not a forecast. Our own approach is described in how to test a gold EA before buying and free gold EA backtest on real ticks.

Execution: closing a basket of 10 positions

A grid that has opened many orders must close them together when its exit triggers. The MQL5 reference describes OrderSendAsync as a function that does not hold the program while waiting for the server's result; the MQL4 reference lists it among the things new in MQL5. On MT5 an EA can therefore send all closing requests in a batch instead of one by one.

Our own number, from porting the Midas advisor: on MT5 a basket of 10 positions closed in about 0.3 seconds, while the older MT4 version, closing orders in sequence, took roughly 330 ms per order, about 3 seconds for 9 orders (read from one broker statement). That is one measurement on one broker; speed also depends on the broker, the VPS and the ping. In a later live comparison of an MT4 and an MT5 bot over about 40 hours we could not show a statistically significant difference, and the visible gap came from a single basket during a fast move. Treat faster closing as a plausible advantage, not a guarantee.

Hedging and netting: why a grid needs a hedging account

MT5 keeps positions in one of two retail ways, chosen by the broker for each account. On netting there is one position per symbol, and every new deal merges into it. On hedging every order stays its own position, and opposite positions can be open together. MetaQuotes added hedging to MT5 on 1 April 2016, in build 1295, and the notes for build 1325 call the new system similar to the one used in MT4.

A grid EA tracks every order, with its own volume and exit. On a netting account the orders merge, so the EA cannot close "the third order" at its own price, and a lock (an opposite order of the same size) would reduce the position instead of sitting next to it. So the account type matters more than the platform number: MT4 keeps each order separately like hedging, while on MT5 you must make sure the account is a hedging one. The full explanation, with a worked example, is in hedging vs netting in MT5.

Brokers and the future of MT4

In January 2018 MetaQuotes announced that it would stop selling new MT4 licences, including extra servers for existing clients, and said further functions would be implemented only in MT5. Support, security updates and fixes for MT4 continue. Later press reports describe brokers moving clients to MT5. We found no official date on which MT4 will be switched off, so "MT4 is being closed" is not a fact we can cite.

The iOS episode shows the practical risk of depending on one app: MetaQuotes' MT4 and MT5 mobile apps were removed from Apple's App Store on 24 September 2022 and returned on 6 March 2023 (press reports). Android was not affected, and an EA running on a VPS does not depend on the phone app.

For you this means: MT4 will work for a long time on brokers that already have it, but new features, new brokers and new tools are on the MT5 side. If you choose a broker today for a long-running EA, check that it offers MT5 hedging accounts for your country.

Moving an EA from MT4 to MT5

MQL4 and MQL5 are different languages with different trading functions, so an MQL4 EA does not run in MT5 as it is. MetaQuotes' own porting article says it is not easy to rewrite all programs, that some MQL4 constants are missing in MQL5, and that indicator calls change to a handle-and-buffer model. Trade logic that assumes one ticket per order has to be rewritten around positions, deals and orders.

In practice you need the source code (.mq4), not just the compiled file (.ex4). If a seller gives only .ex4, ask for an MT5 version; do not expect a converter to work. An MT5 EA also needs a hedging account when it keeps several positions on one symbol. The steps for installing one are in how to install Midas in MT5.

Cent accounts on MT5

A cent account shows the balance in cents and prices the same lot about 100 times smaller. Whether a broker offers it on MT4, MT5 or both is the broker's choice, so check both the platform and the margin mode. Midas needs a hedging cent account on MT5; ProCent at RoboForex is one example, not a recommendation. See what a cent account is and how to open the right account.

What to choose: a short checklist

  • Choose MT5 if you are starting now, want to test on real ticks, run a grid or lock that needs hedging, or use an EA written for MT5, such as Midas.
  • Stay on MT4 if you already own a working MQL4 EA without source code, your broker has no MT5 hedging account, or you rely on an old indicator that has no MT5 version.
  • Either way, check the account's margin mode, the broker's rules for your country, and run the EA on a demo or in a tester before real money.

Trading with leverage carries risk: if the deposit is too small, a stop-out is possible. The comparison above describes platforms, not results, and nothing here is a promise of income.

Related: Martingale 2.0: why a doubling grid exits after a pullback of about $2 shows how the lot rule of a grid EA shortens the way back to break-even.

FAQ

Is MT4 being shut down?

There is no official shutdown date that we could find. MetaQuotes stopped selling new MT4 licences in January 2018 and said new functions will come only to MT5, while support and fixes for MT4 continue. Existing MT4 brokers still run it, but fewer new brokers will.

Can I run an MT4 expert advisor in MT5?

Not as it is. MQL4 and MQL5 are different languages, so an MT4 EA must be rewritten in MQL5, which needs its source code. A compiled .ex4 file cannot simply be copied over. Ask the author for an MT5 version.

Which platform is better for gold (XAUUSD)?

For an EA, MT5: tests on real ticks and hedging accounts matter more on a fast-moving instrument like gold. Gold itself trades on both platforms at most brokers. The best platform is the one where your EA is supported and your broker offers the right account type.

Does a grid EA need a hedging account?

Yes, if it keeps several orders and opposite positions on one symbol. On a netting account all orders merge into one position, so the EA cannot manage them separately. Midas needs a hedging cent account on MT5.

Is MT5 faster at closing many orders?

MT5 allows sending requests asynchronously, so an EA can close a basket as a batch. In our port a 10-position basket closed in about 0.3 seconds on MT5. Real speed depends on the broker, the VPS and the connection, and it is not guaranteed.

Are MT4 backtests less accurate than MT5?

They are less precise on tick detail. MT4 history holds Bid only and models ticks and spread; MT5 can test on real broker ticks. Neither predicts the future, and a good result in a test does not promise a result in live trading.

Can I use a cent account on MT5?

Yes, if your broker offers one. Midas runs on a hedging cent account on MT5. Check the broker accepts clients from your country and that the account is hedging, not netting.

Do MT4 and MT5 differ in indicators and charts?

MT5 has 21 timeframes against 9 in MT4, but the standard indicators exist on both. MT4 has a larger library of old third-party indicators; many have no MT5 version.

Sources

Retrieved 26 October 2026.