New

Complete Suite: all 11 tools. 5 new Premium desks inside.All 11 tools $557.98 one by one

$557.98 one by one $97 once Save $460.98Get the SuiteGet it
ProEA Lab · MT5, TradingView and trading research · Evidence standards

How to Open an .ex4 or .mq4 File (MT4), and Whether MT5 Can Run It

Open yours below. Nothing is uploaded, and an .ex4 is never decompiled.

Open an .mq5, .ex5, .set or .tpl file here. It's read in your browser, never uploaded; a compiled .ex5 is identified, never decompiled.

Example · ProEA-Example-EA.mq4

MT4 only
Type
MT4 source (.mq4)
Program
Expert Advisor
Goes in
MQL4\Experts
Inputs
4
  1. 1Open Data Folder
  2. 2Drop in Experts
  3. 3Compile in MetaEditor
See its 4 inputs
  • InpLotsLot size · double0.1source: 0.10
  • InpStopPointsStop loss, points · int300
  • InpTakePointsTake profit, points · int600
  • InpCommentOrder comment · stringproea-examplesource: "proea-example"
#property lines (1)
  • strict(set)

Next step

Compile it in MT4's MetaEditor

Open it in the MetaEditor that comes with MT4 and compile it; the .ex4 it builds appears in Navigator. MT5 can't run MQL4: for MT5 the code has to be ported to MQL5, because the trading functions differ, then compiled in MT5.

Know someone stuck with an .ex5 or a .set?

Sell EAs? The install note for your buyers. The example files are ours; the example EA compiles in MetaEditor with 0 errors and places no trades. The .mq4 example is written for MT4 and wasn't compiled here: MT4 isn't installed on our machine.

PL · 5 min read

An .ex4 is a compiled MetaTrader 4 program: you don't read it, you run it, from MQL4\Experts, MQL4\Indicators or MQL4\Scripts in MT4's data folder. An .mq4 is its source, opened and compiled in MT4's MetaEditor. MT5 runs neither as it is. The opener above names your file's folder and reads an .mq4's inputs. We read MetaQuotes' MT4 help on 2026-10-24.

Which MT4 file do you have?

Look at the ending. An .ex4 is compiled and runs in MT4. An .mq4 is source code you can read and edit. An .mqh is an include file that other programs pull in when they compile. A .set holds an EA's input values.

How do I open an .ex4 file?

You run it rather than open it. In MT4:

  1. File, then Open Data Folder. MetaQuotes' data structure help points to that command for finding the folder, which sits under C:\Users\<you>\AppData\Roaming\MetaQuotes\Terminal\.
  2. Put the file in the right MQL4 folder: Experts for an EA, Indicators for a custom indicator, Scripts for a script. Ask the seller which it is if the file name doesn't say.
  3. Refresh the Navigator. Right-click in it (Ctrl+N opens it) and choose Refresh. MetaQuotes' Navigator help says this "is necessary when copying already compiled files to the corresponding folder".
  4. Attach it to a chart from the Navigator.

There's nothing to read inside an .ex4: the opener above identifies it by name and reads no further.

Can I convert an .ex4 back to .mq4?

Not with anything we offer. An .ex4 is compiled code, and ProEA doesn't decompile files. To read or change the program, ask whoever sold it for the .mq4 source. That's also why we sell our own EA as source: you can read every line before you run it.

Can MT5 run an .ex4 or .mq4?

No. MT5 runs .ex5 programs compiled from MQL5 source. The broker ActivTrades' help centre says .mq4 and .ex4 files will not work on MT5; we haven't tried it ourselves. MT4 vs MT5 covers the details:

  • With the .mq4, a programmer can port it to MQL5. Since build 600, MQL4 shares MQL5's event handlers, so the work is mostly in how the EA reads indicators and sends orders.
  • With only the .ex4, there's nothing to port. Ask the seller whether an MT5 version exists.

How do I open an .mq4 file?

In MetaEditor, the editor that comes with MT4. MetaQuotes' MetaEditor help: it's "intended for creation, editing, and compilation" of MQL4 programs, and compiling builds the executable the terminal runs. Open the file there, compile it, and the .ex4 appears in the Navigator.

To read its inputs without installing anything, drop it in the opener above: it lists each input and extern with its default value, and says whether the file is an EA, an indicator or a script.

Where do MT4 files go?

In the MQL4 folder of MT4's data folder, laid out by type since build 600, per MetaQuotes' data structure help:

FolderWhat goes in it
MQL4\ExpertsExpert Advisors
MQL4\IndicatorsCustom indicators
MQL4\ScriptsScripts
MQL4\Include.mqh and .mq4 files that other programs include
MQL4\LibrariesLibraries, as .mq4 source and the .ex4 compiled from it
MQL4\PresetsPreset (.set) files

How do I let an EA trade in MT4?

Turn on Allow Auto Trading for the terminal, and the EA's own permission. MetaQuotes' Expert Advisors settings help: with the terminal option off, "no Expert Advisor will be allowed to trade, even if you enable autotrading in the EA settings". The same switch is a button on the toolbar. Three more options there switch auto trading off when you change account, profile, or a chart's symbol or period.

Where we stand

We read MetaQuotes' MT4 help on 2026-10-24. MT4 isn't installed on our machine, so the example .mq4 in the opener is written for MT4 but wasn't compiled here; MT5's MetaEditor refuses .mq4 files. Files you drop in the opener never leave your browser. For MT5 files, the MT5 file opener reads .mq5, .ex5 and .set.

Frequently asked questions

How do I open an .ex4 file?

You run it rather than open it: an .ex4 is a compiled MT4 program. In MT4, File, then Open Data Folder; put the file in MQL4\Experts for an EA, MQL4\Indicators for an indicator or MQL4\Scripts for a script. Then right-click in the Navigator, choose Refresh, and attach it to a chart from there.

Can I convert an .ex4 to an .mq4?

Not with anything we offer. An .ex4 is compiled code and ProEA doesn't decompile files. To read or change the program, ask whoever sold it for the .mq4 source.

Can MT5 run an .ex4 file?

No. MT5 runs .ex5 programs compiled from MQL5 source, and the broker ActivTrades' help centre says .mq4 and .ex4 files will not work on MT5; we haven't tried it ourselves. With the .mq4, a programmer can port it to MQL5. With only the .ex4, ask the seller for an MT5 version.

How do I open an .mq4 file?

In MetaEditor, the editor that comes with MT4: open it there to read and edit it, then compile it to build the .ex4 that MT4 runs. To read its inputs without installing anything, drop it in the opener above.

Where do MT4 files go?

In the MQL4 folder of MT4's data folder (File, then Open Data Folder): Experts for EAs, Indicators for custom indicators, Scripts for scripts, Include for .mqh files other programs include, Libraries for libraries, and Presets for .set files. That's the layout MT4 has used since build 600.

How do I let an EA trade in MT4?

Two switches. The terminal's Allow Auto Trading, on the Expert Advisors tab of its settings (Tools, then Options) or the button on the toolbar, and the EA's own permission in its properties. With the terminal switch off, no EA can trade, whatever its own setting says.

Continue reading

MT5 Templates: Load a .tpl, Find the Folder, Fix Missing Indicators

An MT5 template is a .tpl file of chart settings: colours, scale, indicators and their settings, drawings, even a running EA. You load it from the chart's Templates menu, and it lives in MQL5\Profiles\Templates. A custom indicator it names only appears if that indicator's own .ex5 is already installed, which is why a template from someone else often opens with gaps.

Oct 24 · ProEA Lab

MT4 vs MT5: What Actually Differs, and Which One to Use

MetaQuotes' own comparison puts MT5 ahead on timeframes (21 to 9), pending order types (6 to 4), broker- or exchange-fed market depth, the economic calendar and a multi-threaded Strategy Tester with real ticks. MT4's main advantage is the EAs already written for it, which MT5 can't run. Read from MetaQuotes' pages on 2026-10-17; the market-depth distinction was corrected on 2026-10-18.

Oct 17 · ProEA Lab

Explainer cover titled MT4 vs MT5: what actually changes. A sketch of two windows side by side, MetaTrader 4 and MetaTrader 5, each with its timeframe buttons above a chart: MT4 has 9, MT5 has 21, and the 12 that only MT5 has are orange. Underneath: timeframes 21 vs 9, pending orders 6 vs 4, a real-tick tester, and .ex4 won't run in MT5.

MT5 for Mac: Install MetaTrader 5, Log In and Add an EA

MetaQuotes makes a macOS installer for MetaTrader 5. It sets up Wine and runs the Windows terminal inside it, on macOS Catalina (10.15.7) or later, Apple M1 chips included. How to install it, log in to your broker, find the data folder, add an EA, and when the web terminal is enough. We run Windows, so every step here is MetaQuotes' own, read on 2026-10-17.

Oct 17 · ProEA Lab

Explainer cover titled How to get MT5 on a Mac. A sketch of the MetaTrader 5 terminal in a Mac window: the chart above, the Toolbox open on its Journal tab, and the start-up line that names Wine 8.0.1 ringed in orange. Steps underneath: For macOS on the download page, agree to Mono and Gecko, EAs go in MQL5 then Experts.