MetaEditor allows you to write code not only in MQL4 and MQL5. You can also edit and compile the C++ and Python source code. In addition, you can use MetaEditor as an external compiler in other development environments.
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).
|
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.
The are a lot of machine learning, process automation, as well as data analysis and visualization libraries for the Python language. The advanced language possibilities can now be applied in the platform through the Python integration module.
Python scripts run directly on platform charts, similarly to regular MQL5 programs.
MetaEditor features special integrated functions for Python development: a wizard for creating blank scripts, the ability to run directly from the editor, output of messages and errors to the common log, and so on.
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:
Example |
---|
"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" |
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
Example |
---|
"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts" |
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:
Example |
---|
"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts" /include:"C:\Program Files\TradingPlatform 2\MQL5" |
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.
Example |
---|
"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /log
|
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).
Example |
---|
"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /s /log
|