MetaEditor Help

Integration with other IDEs

Integration with other IDEs

MetaEditor allows you to write code not only in MQL4 and MQL5. You can also edit and compile a C++ source code (the number of supported languages ​​is to be increased in the future). In addition, you can use MetaEditor as an external compiler in other development environments.

Editing C++ code and DLL compilation

When developing trading programs on MQL4/MQL5, you can easily use third-party C++ DLLs. You can edit C++ source code files (CPP and H) similarly to MQ4, MQ5 and MQH ones. These files in DLL can also be compiled directly from the editor. Microsoft Visual Studio installed on user's PC can be used for that. To compile, open the C++ file and press F7 (Compile command).

Working with DLLs on C++

  • MS Visual Studio compiler installed on a user's PC is used for compiling C++ source codes. MS Visual Studio 2008 and higher (including Express and Community versions) are supported.
  • MS Visual Studio version (32 or 64-bit) should match MetaEditor version.

MetaEditor also provides the ability to easily add exported DLL functions to MQL4/MQL5 file. Simply drag a DLL file from the Navigator window to the open MQ4, MQ5 or MQH file.

Importing functions from DLL

Compiling MQL programs in other development environments #

A MetaEditor executable file can be used as the compiler when working with a source code in external editors. The compiler is started from the command line, specifying the path and name of the file you want to compile:

  • metaeditor.exe /compile:"<full path to the source file>"
  • metaeditor64.exe /compile:"<full path to the source file>"


"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5"

Mass compilation of files in a directory

For mass compilation, set the path to a folder rather than to a file. All source code files in the specified folder will be compiled. Subfolders are not included.

Re-compilation is not performed if a source file already has the appropriate compiled version.

The example below displays mass compilation for the \MQL5\Scripts folder


"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts"

Custom MQL5/MQL4 folder with include files

Programs can use include files (*.mqh) and resource files (*.bmp, *.wav, *.ex4, *.ex5), which are located outside the working directory of the current platform (for example, in the \MQL5 folder of another platform copy on the same computer). Specify the path to this folder using the "/include" key for correct compilation. During compilation, the files will be searched as follows:

  • Include files: [specified directory]\include\[path from #include<...>]
  • Resource files: [specified directory]\[path from #resource "..."]


"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts" /include:"C:\Program Files\TradingPlatform 2\MQL5"

Compilation log

Specify the additional /log key for more information about the compilation process. In this case, <source file name>.log compilation log file is created in the folder containing the source file.


"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /log
Log file: C:\Program Files\TradingPlatform\MQL5\Script\myscript.log

Syntax check

To check a program syntax without compilation, launch MetaEditor from the command line with the /s and /log keys (so that results of the check are displayed in the log file).


"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /s /log
File with the results of the check: C:\Program Files\TradingPlatform\MQL5\Script\myscript.log