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:
- 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\. - Put the file in the right MQL4 folder:
Expertsfor an EA,Indicatorsfor a custom indicator,Scriptsfor a script. Ask the seller which it is if the file name doesn't say. - 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".
- 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:
| Folder | What goes in it |
|---|---|
MQL4\Experts | Expert Advisors |
MQL4\Indicators | Custom indicators |
MQL4\Scripts | Scripts |
MQL4\Include | .mqh and .mq4 files that other programs include |
MQL4\Libraries | Libraries, as .mq4 source and the .ex4 compiled from it |
MQL4\Presets | Preset (.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.

