.EX4

EX4 File

MetaTrader 4 Compiled Program (Expert Advisor / Indicator / Script)
Ask a question
QUICK ANSWER

An EX4 file is a compiled MQL4 program for the MetaTrader 4 trading platform -- an Expert Advisor (trading robot), a custom indicator, or a script. You install it by copying it into the correct MQL4 subfolder in MT4 and dragging it onto a chart. It only runs inside MetaTrader 4, and you cannot decompile it back to source code.

Developer: MetaQuotes Software Corp. Category: Executable Files MIME: application/octet-stream
OPENS ON Windows macOS Linux
Related: .APK · .EXE · .VBS · .JAR

On this page

19k+ extensions indexed
Last reviewed Jul 14, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the EX4 file format?

.ex4 files are created to facilitate the functioning of MetaTrader 4 - a trading terminal developed by MetaQuotes Software Corp. and used across markets such as Forex, Futures, and CFD. An .ex4 file contains compiled MQL4 bytecode, the binary output produced when MQL4 source code is built within MetaEditor, the IDE bundled with the terminal.

.ex4 files can contain three distinct types of programs: indicators, scripts, and Expert Advisors. An Expert Advisor is a kind of automated bot used for automatization of trading and analytical processes, capable of placing and managing orders without manual intervention.

Compiling and decompiling .ex4 files

.ex4 files contain executable bytecode compiled from .mq4 source files. The internal binary format is proprietary to MetaQuotes and changed substantially with MT4 build 600 (February 2014), so files compiled before that build may not load on current terminals. This process can be reversed - it is technically possible to decompile .ex4 files back toward their original MQL4 source using third-party decompilers, though the result is rarely an exact replica of the original code.

How to open an .ex4 file

Installing MetaTrader 4 is not enough to use an .ex4 file. Depending on its content, it first needs to be placed in the correct folder within the terminal's MQL4 data directory:

  • If an .ex4 file contains an indicator, place it in the MQL4\Indicators\ folder.
  • If a file contains a script, place it in the MQL4\Scripts\ folder.
  • If a file contains an Expert Advisor, place it in the MQL4\Experts\ folder.

After placing the file, refresh the Navigator panel in MetaTrader 4 (press F5 or restart the terminal). The MetaTrader 5 successor to this format is .ex5, compiled from .mq5 source code.

Security & safety

RISK: HIGH

An .ex4 is executable trading code that runs with access to your trading account inside MT4. A malicious or careless EA can place losing trades, drain a live account, or (rarely) abuse DLL/web calls. Risk checklist: only run .ex4 files from a trusted source/seller, test on a DEMO account first, keep "Allow DLL imports" off unless the author requires it and you trust them, and be highly suspicious of "free EA" and "ex4 decompiler" downloads - they are a common malware vector. Never run an unsolicited .ex4.

Format details

in a nutshell
FULL NAMEMetaTrader 4 Compiled Program (Expert Advisor / Indicator / Script)
DEVELOPERMetaQuotes Software Corp.since 2005 (MetaTrader 4 platform)
MIME TYPEapplication/octet-stream
TYPECompiled MQL4 bytecode/program for the MetaTrader 4 terminal (binary, not a native OS executable)

Programs that open EX4 files

Windows1 app
MetaTrader 4 Free File → Open Data Folder → MQL4\Experts (or \Indicators / \Scripts), copy the .ex4 in, restart MT4, then drag it from the Navigator onto a chart.
macOS1 app
MetaTrader 4 (broker macOS bundle) Free MT4 is Windows software; download your broker's macOS bundle (Wine-based) or run MT4 in a Windows VPS, then install the .ex4 into MQL4\Experts as on Windows.
Linux1 app
MetaTrader 4 via Wine / VPS Free Run the MT4 terminal under Wine or on a Windows VPS, then place the .ex4 in the MQL4 folder.

Technical details

deep spec
DeveloperMetaQuotes Software Corp.
Platform compatibilityMetaTrader 4 (MT4) terminal only; not loadable in MetaTrader 5
Bytecode typeCompiled MQL4 bytecode; not a native Windows or OS executable
Source languageMQL4 (MetaQuotes Language 4), a C++-like proprietary scripting language
Compiler / IDEMetaEditor, bundled with the MetaTrader 4 terminal
Program typesExpert Advisor (EA), Custom Indicator, Script - one program type per file
Expert Advisor folderMQL4\Experts\
Indicator folderMQL4\Indicators\
Script folderMQL4\Scripts\
Format revisionInternal binary format changed substantially in MT4 build 600 (February 2014); .ex4 files compiled before that build may not run on current terminals
MIME typeapplication/octet-stream
Magic bytesNo stable publicly documented file signature; files are identified by their folder location within the MT4 data directory
Format natureProprietary closed binary format; no public specification
Successor format.ex5 (MetaTrader 5 compiled program, compiled from .mq5 source)
Supported marketsForex currency pairs, CFD, Futures, and Stocks via broker integration
Released2005 (MetaTrader 4 platform)
Specificationwww.mql5.com

EX4 conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with EX4 files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about EX4 files.

Frequently asked questions

How do I open / install an .ex4 file in MetaTrader 4?
In MT4 choose File → Open Data Folder, then copy the .ex4 into MQL4\Experts (for a robot), MQL4\Indicators (for an indicator), or MQL4\Scripts. Restart MT4, then drag it from the Navigator panel onto a chart. For EAs, enable 'Allow algo/automated trading'.
Can I decompile an .ex4 back to .mq4 source?
No - not reliably. Compilation removes the source, and since MT4 build 600 (2014) the format is obfuscated against decompilation. 'ex4 to mq4 decompiler' sites are scams or malware, and decompiling someone else's EA usually breaks its licence. Ask the author for the .mq4.
What's the difference between .ex4 and .mq4?
.mq4 is the human-readable MQL4 source code; .ex4 is the compiled, runnable program produced from it. You edit .mq4 in MetaEditor and compile to .ex4 to run in MT4.
Can I run an .ex4 on Mac or Linux?
Only through MetaTrader 4 itself. MT4 is Windows software, so on Mac/Linux you use your broker's Mac bundle (Wine-based) or run MT4 on a Windows VPS, then install the .ex4 normally.
What's the difference between .ex4 and .ex5?
.ex4 runs in MetaTrader 4 (compiled from MQL4); .ex5 runs in MetaTrader 5 (compiled from MQL5). They are not interchangeable and you can't convert one to the other.
Is it safe to run an .ex4 from the internet?
Treat it like any executable. A bad EA can trade away real money or carry malware. Only run .ex4 files from sources you trust, test on a demo account first, and avoid 'free EA'/'decompiler' downloads.

References

1MetaTrader 4 - official sitewww.metatrader4.com
2MQL4/MQL5 Reference (MetaQuotes documentation)www.mql5.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.DATProgram Data File (generic)
4.JPGJPEG Image
5.EXEWindows Executable (Portable Executable)
6.RPMSGRestricted Permission Message
7.ICSiCalendar data file
8.PARTPartial Download File
9.BINCD/DVD Disc Image (BIN/CUE)
10.JSONJavaScript Object Notation file

Related extensions

.APKAndroid Package
.EXEWindows Executable (Portable Executable)
.VBSVBScript file (Visual Basic Script)
.JARJava Archive
.APPXMicrosoft Windows App Package (AppX)
.AIRAdobe AIR Application Installer Package

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z