1. Checking the syntax of mqh/mq4/mq5 files (without compilation).
2. Compilation of mq4/mq5 files.
3. Compilation of mq4/mq5 files using script.
The script opens the file "mq4/mq5" in the "MetaEditor" and clicks the "Compile" button, thus MT4/MT5 is automatically updated. (The idea is taken from here)
4. Opening the MQL help:
To find a keyword in the MQL help, place the cursor on it or select it, and then press F1.
"Compile ": This option allows you to compile the selected file directly from the context menu of the explorer without opening it.
"Compile with script " This option allows you to compile the selected file directly from the context menu of the explorer without opening it.
"Open in 'MetaEditor' ": This option allows you to open the selected file in “MetaEditor” directly from the explorer context menu.
"Show/hide ex4/ex5 files ": This option allows you to show or hide compiled ex4/ex5 files in the explorer view.
"Insert MQH as #include ": This option allows you to insert the selected mqh file as a #include statement in the current file.
"Insert the file name 'mq4/mq5' in 'mqh' "
(When the "mq4/mq5" file name is specified in the "mqh" file, it allows for improved real-time error checking in the "mqh" file itself. This also eliminates the need to switch to the "mq4/mq5" file window during compilation. In the first line of the "mqh" file, you need to write the name of the "mq4/mq5" file. Example: //###<Experts/Examples/MACD Sample.mq5>)
7. Visualizing and modify mql colors.
8. Quick Print().
This tool facilitates debugging of code using the Print() function.
To use it, place the cursor on a variable or select it, then press the key combination Ctrl+Alt+D .
Start typing ‘mp’, then press Tab or Enter to insert Print() with data from the clipboard.
The context menu of the editor has added the following items under 'MQL Tools': 'Comment out all Print() ', 'Uncomment all Print() ', 'Remove all Print() '.
9. Styler.
The Styler tool performs the same functions as the standard SHIFT+ALT+F code formatting or the standard CTRL+K CTRL+F selection formatting, provided the code is selected. However, Styler does not add spaces to date and color string literals. (D_ '2023.12.29 18:33:56', C_ '128,128,128')
- To use Styler, open the 'MQL Tools' menu from the context menu of the editor or use the 'MQL Tools' menu button on the main panel of the editor and select the 'Styler' item.
- You can also choose the code formatting style in the 'MQL Tools' menu.
10. IntelliSense.
- Autocomplete for variable, constant, and function names - IntelliSense suggests names that can be used in code and provides auto-completion for them.
- Display of function information - when the mouse cursor hovers over a function name, IntelliSense displays information about the function, including a list of parameters, return type, and description.
- Notification of errors - IntelliSense provides real-time information about errors, which helps quickly find and correct mistakes before code compilation.
(IntelliSense is currently operating in test mode)
11. MQL syntax highlighting.
Quick Setup Guide:
Open the folder with MQL files in VSCode. Example: C:\Users\<your name>\AppData\Roaming\MetaQuotes\Terminal\D2E7219F73C8BF37CD8BF550E55FF075\MQL5. (The folder must be named MQL4 or MQL5! This is important!!! )
Specify the path to MetaEditor in the extension settings and, if necessary, the path to "Include" files.
Create or update the “settings.json” configuration file if it exists. Press Ctrl+Shift+P to open the command palette, select "MQL: Create configuration" . (This item is performed automatically, so it can be skipped)
If you wish, you can set icons for MQL files. Press Ctrl+Shift+P to open the command palette, select "MQL: Add icons to the theme" , then select a theme to which icons will be added (icons can be added only to certain 4 themes).
Recommendations:
- When working in MacOS and Linux.
- If possible, do not use spaces in file names.
- Compilation and code verification can take a long time. To speed up these processes, it is recommended to always keep the MetaTrader trading terminal open. It is also recommended to open the MetaTrader trading terminal through the 'MQL Tools' menu.
Release Notes:
0.1.0
0.1.1
- Added 'error' and 'warning' icons to the output channel
- Added Help in Korean
- Added Korean translation of errors and warnings in the output channel
- Added
'Portable MT4' and 'Portable MT5' items to the extension settings
0.1.2
- Fixed a bug when working with the 'portable' version of MetaTrader
0.1.3
- Fixed an error when opening help when there are spaces in the path to the '.chm' file
2.0.0
- Improvements have been made to the operation of IntelliSense
- Real-time code error checking has been added, with indication of errors through wavy lines in the editor
- A tool has been added to simplify working with the Print() function during code debugging.
- Added the ability to use the
'${workspaceFolder}' variable in the path to include files and metaeditor.exe
- The comment creation tool for functions has been updated
- Syntax highlighting in the output channel has been changed
- Added the function of automatically creating the 'settings.json' file, which is located in the '.vscode' folder.
2.0.1
- Improvements have been made to checking the code for errors in real time
- Changes have been made to
'Insert MQH as #include'
2.0.2
- Fixed the bug that caused the errors "command 'mql_tools.compileFile' not found", "command 'mql_tools.compileScript' not found" and the like
2.1.0
- Added the ability to compile on Linux and MacOS using Wine
- Added downloading of up-to-date help versions
- Added code formatting styles
- Methods for matrix and vector have been added to IntelliSense.
- Added Menu 'MQL Tools' button to the main menu of the editor
- Added
'Compile' and 'Compile with script' items to the Explorer menu
- The
'Fixing date time and color after formatting' item has been replaced by 'Styler' in the 'MQL Tools' menu.
- Added items to the 'MQL Tools' menu:
Open 'MetaEditor'
Open trading terminal
Insert Color as clrColor
Select formatting style
| |