Convert an MT4 EA or indicator to MT5
Your broker or prop firm moved to MT5, or you want MT5’s real-tick Strategy Tester. MQL4 code does not run on MT5, and automatic converters miss the parts that matter. I rewrite the EA for MT5’s order model and check that it trades the same way.
Mutual NDA before you share your strategy · reply within one working day
1// MQL4: one call, ticket-based2int ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, 3, sl, tp, "", Magic, 0, clrNONE);3 4// MQL5: orders, deals and positions are separate things5CTrade trade;6trade.SetExpertMagicNumber(Magic);7trade.SetDeviationInPoints(3);8trade.SetTypeFillingBySymbol(_Symbol); // brokers differ: FOK, IOC, RETURN9if(!trade.Buy(lots, _Symbol, 0.0, sl, tp))10 Print("buy failed: ", trade.ResultRetcode(), " ", trade.ResultRetcodeDescription());- Starting price
- $150
- Typical delivery
- 3–7 days
- Revisions
- 2 revision rounds
- Handover
- MQL5 source + comparison
The parts of an EA that have to be rewritten.
| Area | MQL4 | MQL5 |
|---|---|---|
| Trading | OrderSend / OrderSelect loops over tickets | CTrade, positions and deals, plus OnTradeTransaction for reliable tracking |
| Indicators | iMA() returns a value directly | Create a handle once, then CopyBuffer() on each bar |
| Prices | Bid, Ask, Close[0] are always there | SymbolInfoTick() and CopyClose(), with checks |
| Accounts | Hedging only | Hedging or netting, and the EA must handle the one it is on |
| DLLs | 32-bit | 64-bit only, so old DLLs need replacing |
Proof it still trades the same way.
- 01
Same period, both platforms
The MT4 original and the MT5 version are tested over the same dates on comparable data.
- 02
Trade-by-trade comparison
Entries, exits and sizes are compared, and every difference is traced to data or platform behaviour rather than a bug.
- 03
Tick-data test on MT5
Then a proper MT5 test on real ticks, which is often the first realistic test the EA has ever had.
Common questions
Can MT5 run my MT4 EA directly?
No. MT5 cannot run .ex4 files or compile MQL4 code. The EA has to be rewritten in MQL5, which is also a good moment to fix anything fragile in the original.
What if my MT5 account is a netting account?
On netting accounts, each symbol holds one position, so EAs that open several trades on the same symbol behave differently. The converted EA detects the account type, and we agree how it should behave on each.
Do the custom indicators the EA uses need converting too?
Yes, if the EA calls them. They are included in the quote once I have seen the code.
I only have the .ex4 file. Can you convert it?
Not directly. Compiled files cannot be converted. If you can describe the logic or let me observe it on a demo account, I can rebuild it in MQL5 as a new project.
Tell me the strategy. I’ll tell you what it takes.
Fifteen minutes, no pitch. Mutual NDA before you describe anything you care about. You get an honest view of feasibility, timeline and price, even if the answer is “don’t build this”.