Loading...
Source code files written in MetaQuotes Language 4 for MetaTrader 4 trading platform.
File type:
The .mql4 file extension represents source code files created with MetaQuotes Language 4 (MQL4), programming scripts used within the MetaTrader 4 trading platform. These files typically contain trading algorithms, custom indicators, scripts, and automated expert advisors.
File type category:
Date updated: July 6, 2026
MQL4 is a specialized programming language designed for developing trading strategies, indicators, scripts, and functions within the MetaTrader 4 platform. The language is similar to C++, making it accessible to traders with programming experience. MQL4 files are plain text files with the .mql4 extension, which are compiled into executables used by MetaTrader 4 to automate trading tasks.
The history of MQL4 dates back to the early 2000s when MetaQuotes Software introduced it as a means for traders to develop their own automated trading programs. MQL4 provides extensive libraries for technical analysis, order management, and communication with trading servers. Besides manual programming, many traders utilize pre-written Expert Advisors (EAs) and indicators, which are often shared and downloaded from various online sources.
Platform compatibility is primarily focused on the Windows version of MetaTrader 4, although some development tools enable editing and managing these files on other operating systems like macOS and Linux through emulators or compatible software. The language is well-supported by MetaQuotes' own MetaEditor development environment, which offers syntax highlighting, debugging, and compilation features, streamlining the development process for traders and programmers alike.
To open and edit .mql4 files, users should install MetaTrader 4 along with MetaEditor, the integrated development environment. On Windows, MetaTrader 4 is the primary platform, and via MetaEditor, you can open, compile, and debug MQL4 scripts.
For Mac OS users, running MetaTrader 4 and MetaEditor may require using Wine or similar compatibility layers. Linux users can set up MetaTrader 4 via Wine or use virtual machines. Once installed, simply open the MetaEditor, browse to the .mql4 file, and start editing or compiling.
Converting .mql4 files to other formats is not typically required as they are source code files intended for editing and compilation within MetaTrader 4. However, if you need to share or migrate code, you can copy the .mql4 source files and convert them into scripts or other programming formats manually.
For conversion or editing outside MetaEditor, some code editors support syntax highlighting for MQL4, but full compilation and execution require MetaTrader 4. Online repositories might offer tools or scripts to translate or refactor MQL4 code. Additionally, some IDEs and plugin tools exist that can convert or assist in porting MQL4 code for use with other trading platforms, but these are generally limited and require manual adjustments.