What Is an EX4 File?

How to Open, Edit, & Convert EX4 Files

Screenshot of several EX4 files in Windows 10 that open with MetaTrader 5
EX4 Files.

A file with the EX4 file extension is a MetaTrader Program file. It's compiled programming code made for the free foreign exchange market trading program called MetaTrader.

Stored in an EX4 file may be scripts or indicators used by the MetaTrader program. It may instead be an Expert Advisor (EA) program used by MetaTrader for automating trading.

The programming code in the EX4 file is compiled from an MQ4 file, which is a MetaTrader Custom Indicator file. This is done through a tool called MetaEditor that comes installed with MetaTrader.

EX4 files are used with MetaTrader 4, so EX5 files are very similar but are used by MetaTrader 5. MQH is another MetaTrader file format, called a MetaTrader Include file—you might see MQH files saved with EX4 and EX5 files.

Note: Ext4 is a file system that has nothing at all to do with EX4 files.

How to Open an EX4 File

EX4 files can be opened with the free MetaTrader program from MetaQuotes. It works on Windows, macOS, and Linux. However, you might not be able to just double-click or double-tap the file and have it open in MetaTrader.

You can open the EX4 file another way, by putting it in the right folder inside the MetaTrader program's installation directory. For example, if you're using MetaTrader 5, this folder is most likely "C:\Program Files\MetaTrader 5\MQL5."

Once you're in that folder, you'll see several other subfolders. You have to know what the EX4 file is, specifically, so you know where to put it. It can be an indicator, Expert Advisor (EA), or script—put the EX4 file in the "Indicators" folder if it's an indicator, the "Experts" folder if an EA, and the "Scripts" folder for EX4 files that are scripts.

In MetaTrader, you can see these files in the "Navigator" window. If you don't see that window, enable it in the View > Navigator menu.

Note: The EX4 file extension, though it shares some of the same letters, isn't the same as a file that has the EXO, EXR, EX_, or EXE file extension. Follow those links to learn more about those file formats.

If you find that an application on your PC does try to open the EX4 file but it's the wrong application or if you would rather have another installed program open EX4 files, see my How to Change the Default Program for a Specific File Extension guide for making that change in Windows.

How to Convert an EX4 File

Since EX4 files are the compiled equivalent of MQ4 files, you'd need a decompiler to "convert" the EX4 to MQ4. I'm not aware of any decompilers that can do this.

You might also be able to convert an EX4 to EX5 or AFL (AmiBroker Formula Language). If so, it's most likely done through the MetaTrader program itself, but I haven't verified this myself.

More Help With EX4 Files

See Get More Help for information about contacting me on social networks or via email, posting on tech support forums, and more. Let me know what kinds of problems you're having with opening or using the EX4 file and I'll see what I can do to help.