What Is an MQ4 File?

The MetaQuotes Language 4 format uses MQ4 for its source code

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 MQL4.com.

MQ4 files in Windows that open with MetaTrader 4

Although they look similar, MQ4 files are not at all related to MP4 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 like MetaTrader 5.

Instead, install the older version to open the MQ4 file. You can download MT4 from FXCM.

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

MQ4 file open as a text document
MQ4 File Open in Notepad++.

If you find that an application on your PC does try to open the MQ4 file but it's the wrong application or you'd 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

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 to copy its contents, and then paste it into that website and hit the convert button to produce the C# result.

Read this how-to to learn how to convert MQL 4 code to MQL 5 code.

Still Can't Open the File?

If the file doesn't open with MetaTrader, then it's likely that you're misreading the file extension. This is actually fairly easy to do since there are other file extensions that are spelled almost exactly like MQ4 but aren't at all associated with MetaTrader.

MQO is a good example. This file extension is used by Metasequoia Document files and can only open with Metasequoia.

Another type of file that's easy to confuse for an MQL4 Source Code file is a Sony Movie Format file. These are videos that use the MQV file extension, so they require a video player like QuickTime in order to be played.

Double-check the file extension at the end of your file to make sure you're reading it correctly, and then do some research on the web to learn more about the format it could be in and the programs that are able to open and convert it.