How to Open and Convert MQ4 Files

The MetaQuotes Language 4 format uses MQ4 for its source code

Screenshot of several MQ4 files in Windows 10 that open with MetaTrader 4
MQ4 Files.

A file with the MQ4 file extension is an MQL4 Source Code file. MQ4 files contain variables and functions, as well as comments, related to the MetaQuotes Language 4 programming language.

You can read a lot more on this format, and MQ4 files, at

Although they look similar, MQ4 files are not at all related to MP4 video files.

How to Open an MQ4 file

Open MQ4 files with MetaQuotes MetaTrader platform. However, because MQ4 files are associated with version 4 of the MetaTrader program, you probably can't use one in newer versions, such as MetaTrader 5.

Instead, install the older version to open the MQ4 file. Download MT4 from FXCM.

MetaTrader 4 is also available for iOS devices and on Google Play for Android devices.

In addition to the native client applicatio, open an MQ4 file with Notepad or any other text editor to see the source-code information—but it isn't the best method of viewing an MQ4 file since the MetaTrader program is built specifically for using this file and displaying its information properly.

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

How to convert an MQ4 file

If you need to convert MQ4 to MQ5 so that the file will open in a newer version of MetaTrader, use a free online MQL converter. Upload the MQ4 file to effect the conversion—you don't need to download any software, because the tool converts the file online.

MetaTrader 4 converts MQ4 files to EX4 automatically when you import the file into the Indicators folder. If you have MetaTrader open when the file is copied into that folder, close and reopen the program to generate the EX4 file.

You can convert MQ4 to C# with the online MQ4 to cAlgo Converter. Open the MQ4 file with a text editor and then select the Convert button on that conversion website to produce the C# result.