Skip to content
AlgoVerdict
Menu

Broker & VPS · As of 8 Nov 2026

Moving an EA from MT4 to MT5: step by step with a checklist

Short answer: an .ex4 file does not run in MetaTrader 5, and no converter turns it into an .ex5. You need either an MT5 version from the vendor or the MQL4 source code, which someone ports to MQL5. Then you open an MT5 account with the right account model (hedging for most MT4 EAs), adjust symbol names and settings, retest in the MT5 strategy tester, set up the terminal and VPS, and run the EA on demo in parallel for a few weeks before switching MT4 off.

AlgoVerdict editorial team, responsible: Pitt PetruschkeUpdated

On this page

MetaQuotes no longer develops MetaTrader 4, and among the prop firms in our reviews The5ers and E8 Markets no longer offer MT4 at all. If you run an EA on MT4, you will have to move sooner or later. That is more than a new terminal: the program file, the account model, symbol names and test results all change. This guide walks through the process in eight steps, with a checklist at the end. Why MT5 is the better platform for algo traders is covered in MT4 vs MT5 for algo trading.

Step 1: Work out what you have of the EA

Before you install anything, find out in which form you own the EA. That decides whether the move takes minutes or weeks.

  • Only the .ex4 file: the most common case for purchased EAs. The file is compiled and only runs in MT4. You need an MT5 version from the vendor.
  • A purchase from the MQL5 Market: the product belongs to one platform. Many sellers list the MT4 and MT5 versions as separate products. If the product page says nothing about it, ask the seller.
  • A licence directly from the vendor: often tied to the account number. Ask whether the licence covers MT5 and how to get the new account number activated.
  • The source code (.mq4): then a programmer can port the EA to MQL5. Without source code that is not possible.

Step 2: Get an MT5 version or port it

An .ex4 file cannot be converted into an .ex5 file, and MetaTrader 5 does not start MT4 programs. Offers online to “convert” or “decompile” compiled EAs are generally dubious and almost always breach the vendor’s licence.

With source code a port is possible, but it is not just a recompile. MQL5 differs in places that affect every EA: prices come from functions instead of Ask and Bid, indicators return a handle whose values you read with CopyBuffer, orders and positions are separate objects, and from H1 upwards the numeric values of the timeframe constants no longer equal the number of minutes. The MQL5 article “Migrating from MQL4 to MQL5” lists the equivalents. After every port, plan a complete new test, as if it were a new EA.

Step 3: Open an MT5 account with the right account model

MetaTrader 5 has two position accounting systems. According to the help, with netting there is only one common position per symbol; with hedging you can hold several positions on the same symbol, including opposite ones. Which system an account uses depends on the account and is set by the broker.

MT4 always works like hedging. An EA that opens several trades on one symbol, builds a grid or holds long and short at the same time therefore needs an MT5 hedging account. On a netting account a second order would increase or close the first. Ask your broker about the account model before you deposit. Which brokers from our reviews offer MT5 is shown in best MT5 brokers.

Step 4: Adjust symbols and settings

On the new account symbols are often named differently. Many brokers add suffixes, for raw or ECN accounts for example, and gold may be listed as XAUUSD or GOLD. Check the names in Market Watch and enter them in the EA’s inputs if it expects symbol names.

Also compare contract size, digits, minimum lot and lot step in the symbol specification (right-click the symbol, Specification) with the old account. An EA that calculates in points instead of pips will otherwise set stops ten times too tight or too wide. Do not copy the old input parameters blindly from a .set file; check every value, and give the EA its own magic number if several EAs share the account. How much margin the positions tie up at the new leverage is shown by the margin calculator.

Step 5: Retest in the MT5 strategy tester

Test the MT5 version in the strategy tester before it goes onto an account. According to the help, MT5 offers the mode Every tick based on real ticks, which tests on ticks collected by the broker. MT4, by contrast, models ticks from smaller timeframes (Every tick, Control points, Open prices only).

So expect differences from the old MT4 report. Set spread, commission and execution delay as they apply on the new account, and compare win rate, profit factor and maximum drawdown. Small differences are normal. Large ones mean either a bug in the port or a strategy that only looked good in MT4’s coarse simulation. How to read backtests properly is in backtesting and forward testing.

Step 6: Set up the terminal and VPS

Install MT5 from your broker, log in with the new account and attach the EA to the chart as usual. The individual clicks are shown in install MetaTrader 5 and run an EA. If you run several terminals side by side, install MT5 in portable mode; then each terminal keeps its programs and settings in its own folder.

On a VPS, MT4 and MT5 run side by side without problems. MT5 needs more memory, though; sizes are in VPS for Expert Advisors, the setup in set up a VPS for MetaTrader. If you use the MQL5 VPS, the MT5 account needs its own subscription, because a virtual terminal works with exactly one account and one platform. How the migration works there is explained in MQL5 VPS explained.

Step 7: Run it in parallel on demo

Let the MT5 version run for at least two to four weeks on an MT5 demo account at the same broker while the MT4 EA keeps working. Compare entries, exits, lot sizes and the behaviour around news and weekends trade by trade.

Pay special attention to situations the backtest represents poorly: requotes, slippage, partial fills and the behaviour after a terminal restart. An EA that cannot find its state again after a restart quickly loses track of its own positions on a netting or hedging account.

Step 8: Switch over and turn MT4 off

Only switch once both versions trade the same way. Decide beforehand what happens to open MT4 positions: let them run out while the MT4 EA opens no new trades, or close them deliberately. Never let both versions trade the same strategy with real money, or you double your risk.

Then turn off the MT4 terminal on the VPS and document the new settings (symbol, input parameters, magic number, account model). Start on the live account with the smallest sensible lot size and only increase once the first weeks match the demo run.

Checklist for the move

  • MT5 version from the vendor or source code available, licence for the new account number sorted
  • MT5 account with the right account model (hedging for grid, martingale and multi-trade EAs)
  • Symbol names and suffixes entered in the EA
  • Contract size, digits, minimum lot and lot step compared with the old account
  • Input parameters checked one by one, own magic number assigned
  • Backtest in MT5 on real ticks with the new account’s costs
  • Terminal in portable mode, VPS with enough RAM or a separate MQL5 VPS subscription
  • Algo trading enabled in the terminal and the EA, autostart after a reboot checked
  • At least two to four weeks of parallel demo testing, compared trade by trade
  • Plan for open MT4 positions, MT4 EA switched off only afterwards
  • Go live with the smallest lot size

Conclusion

Moving from MT4 to MT5 rarely fails on technology, but on assumptions: that an .ex4 file somehow comes along, that the new account calculates like the old one, or that an MT4 backtest also applies to MT5. Work through the eight steps calmly and run the EA in parallel on demo, and you move without nasty surprises. Which EAs exist for MT5 at all and how they do in our tests is shown in our EA reviews. If you are considering a different platform altogether, the comparison is in cTrader vs MetaTrader for algo traders.

Sources

All read on 8 Nov 2026:

Frequently asked questions

Can I use an .ex4 file in MetaTrader 5?

No. MetaTrader 5 only runs .ex5 programs, MetaTrader 4 only .ex4. A compiled file cannot be reliably converted into the other format either. You need an MT5 version from the vendor or the source code (.mq4) from which someone writes an MQL5 program.

Is it enough to compile the MQL4 source in MT5’s MetaEditor?

Almost never. MQL5 has a different position model, different functions for prices and indicators (handles and CopyBuffer instead of direct values) and different timeframe constants. Simple indicators can be rewritten with moderate effort; an EA with order management needs a real port and a new test.

Netting or hedging: which MT5 account do I need for an MT4 EA?

For most MT4 EAs a hedging account. On MT4 an EA can hold several positions on the same symbol, including opposite ones. On a netting account there is only one position per symbol, so grid, martingale and hedging EAs do not work as intended. Your broker sets which model your account uses.

Do I have to buy an MQL5 Market EA again?

That depends on the vendor. Many sellers list the MT4 and MT5 versions as separate products. If the product page says nothing about a version for the other platform, ask the seller before buying. Licences outside the Market are often tied to account numbers; the new MT5 account number then has to be activated.

Why does the MT5 backtest give different results than MT4?

Because MT5 can test on real ticks while MT4 interpolates ticks from minute data. On top come different price data, spreads and commissions on the new account and differences in the ported code. Small deviations are normal; large ones point to a bug in the port or to a strategy that only looked good in MT4’s coarse simulation.

How long should I run the EA in parallel on demo?

At least two to four weeks, or until a meaningful number of trades has built up. Compare entries, exits and lot sizes trade by trade with the MT4 account. Only switch over once both trade the same way.

Can I run MT4 and MT5 on the same VPS?

Yes. Both terminals run side by side on a Windows VPS, most cleanly in portable mode with separate folders. Plan more memory for MT5 than for MT4. The MQL5 VPS, on the other hand, is tied to one account and one platform: the MT5 account needs its own subscription.

Want more tests like this?

The digest arrives on Sundays with new and updated tests based on real accounts. Only when there is news, unsubscribe anytime. About the digest

By subscribing you agree to receive the digest by email. You confirm via a link (double opt-in) and can unsubscribe anytime via the link in every email. Details in the privacy policy.