Loading...

MQ4

mq4 icon

MetaQuotes Language 4 source code

File type: Source code and script file

The .mq4 file is a source code file written in MetaQuotes Language 4 (MQL4), which is used to develop trading robots, indicators, scripts, and libraries for the MetaTrader 4 platform. These files contain programming code that automates trading tasks and enhances the functionality of MetaTrader 4.

What is mq4 file?

File type category:
Source code and script file

Date updated: June 21, 2026

.mq4 files are text-based source code files created with the MetaEditor integrated development environment (IDE) for MetaTrader 4. They are used to program custom trading scripts, Expert Advisors (EAs), indicators, and libraries that automate and analyze trading activities within MetaTrader 4.

MetaQuotes Language 4 (MQL4) is a C-like programming language designed specifically for developing trading automation software. MQL4 scripts can be compiled into executable .ex4 files that can be run within MetaTrader 4. The .mq4 source files are editable and customizable by traders and developers to create complex trading algorithms, automated trading strategies, or custom technical indicators.

These source code files are compatible across different operating systems when used with tools like MetaEditor on Windows. Cross-platform development or editing is possible through Wine or virtualization software on Mac and Linux systems. Given MetaTrader 4's popularity in retail Forex trading, the .mq4 format remains a common choice for traders developing automated trading systems and custom indicators.

How to open mq4 file?

To open, view, and edit .mq4 files, you should use MetaEditor, the integrated development environment included with MetaTrader 4. MetaEditor is available on Windows via the MetaTrader 4 installation package, which can be downloaded from the official MetaTrader website or through your broker.

For Mac and Linux users, opening or editing .mq4 files usually requires running Windows through virtualization software such as Parallels, VMware, or using Wine to run MetaTrader 4 and MetaEditor. Alternatively, plaintext editors with syntax highlighting for MQL4, like MetaEditor or other code editors, can be used for editing purposes, although they won't compile or execute the code.

How to convert mq4 file?

Converting .mq4 files into executable formats involves compiling them within MetaEditor to generate .ex4 files, which are directly used in MetaTrader 4. Normally, source code editing and compilation are performed within MetaEditor, with the source .mq4 files kept for editing or version control.

There are no widely used online converters for MQL4 source code, as the compilation process is specific to MetaTrader 4. Developers typically manage their .mq4 files using MetaEditor or text editors and then compile them locally to produce executable files for deployment within MetaTrader 4.

The default software to open mq4 file:

Suggested software to open mq4 file:

Associated software actions with the mq4 file

Software applications that can open mq4 files:

Microsoft Windows

Software applications that can edit mq4 files:

Microsoft Windows

Software capable of saving mq4 files:

Microsoft Windows

Convert .mq4 files

Convert to .mq4 from other formats

Related file extensions