MyAlgoMate
// ALGORITHMIC TRADING

How to Install an EA in MT4 or MT5 (.ex4, .ex5, .mq4, .mq5)

Rishi Ajmera · · Last updated

Share

An Expert Advisor (EA) comes as a ready-to-run file (.ex4 for MT4, .ex5 for MT5), and often with its source code (.mq4 or .mq5). Installing it means copying the file into MetaTrader's data folder and attaching it to a chart.

Step by step

  1. In MetaTrader, open File → Open Data Folder.
  2. Open MQL5 → Experts (in MT4: MQL4 → Experts) and copy the EA file there. Indicators go in the Indicators folder next to it, and .mqh files in Include.
  3. Back in MetaTrader, open the Navigator (Ctrl+N), right-click Expert Advisors and choose Refresh — or restart MetaTrader.
  4. Drag the EA onto a chart of the symbol and timeframe it was built for.
  5. In the window that opens, go to the Common tab and tick Allow Algo Trading (MT4: Allow live trading), then set your values on the Inputs tab and click OK.
  6. Make sure Algo Trading is on in the toolbar. See how to turn on Algo Trading in MT5.

If you only have the source code (.mq4 / .mq5)

Copy it into the Experts folder, open it in MetaEditor (press F4 in MetaTrader) and click Compile. MetaEditor creates the .ex4 or .ex5 file next to it, and the EA then appears in the Navigator after a refresh.

Saved settings (.set files)

A .set file holds a set of input values. Put it in MQL5 → Presets (MT4: MQL4 → Presets), then click Load on the EA's Inputs tab to use it.

The EA doesn't appear in the Navigator

  • Wrong platform. An .ex4 file runs only in MT4 and an .ex5 file only in MT5. An MT4 EA has to be converted to MT5 before MT5 can use it.
  • Wrong folder or wrong copy of MetaTrader. With several MetaTrader installations, each has its own data folder. Use File → Open Data Folder in the copy you actually run.
  • Not refreshed. Refresh the Navigator or restart MetaTrader.
  • Compile errors. If MetaEditor shows errors when compiling an .mq4 or .mq5 file, the code needs fixing before it can run.

Need an EA built for you?

MyAlgoMate's developers build custom MT4 and MT5 Expert Advisors, indicators and dashboards to your rules, and deliver the source code with the ready-to-run file.

If you live in India: under RBI rules, residents may trade forex only through authorised routes, such as currency derivatives on recognised Indian stock exchanges through a SEBI-registered broker. Check that your broker and the instruments you trade are permitted before you run any EA. MyAlgoMate develops software only and does not advise on brokers, markets or strategies.

FAQ

Which folder do Expert Advisors go in for MT5?

File → Open Data Folder → MQL5 → Experts. For MT4 it is MQL4 → Experts.

Can I use an MT4 EA (.ex4) in MT5?

No. MT5 runs only .ex5 files. The EA has to be rewritten in MQL5 from its .mq4 source code.

What is the difference between .mq5 and .ex5?

The .mq5 file is the readable source code; the .ex5 file is the compiled program MetaTrader runs. MetaEditor turns the first into the second when you click Compile.

Share this page