To enable mql5 intellisense, you can use this plugin:
then, you can save this page as html and open is vscode on second tab. So, all sintax will availble for autocomplete commands
also you can use mql4 Syntax Highlight plugin
and you can add mql5 folder with metaeditor to PATH and then you can compill your code directly in vscode
To enable mql5 intellisense, you can use this plugin:
then, you can save this page as html and open is vscode on second tab. So, all sintax will awailble for autocomplete commands
I just published a new MQL syntax highlight extension that runs on top of cpp so you can use all cpp extensions (Intellisence, clang-format, etc.) with MQL and keep the MQL syntax. In order to make this work you need to map MQL file extensions to cpp in the user settings:
"files.associations": { "*.mqh":"cpp", "*.mq4":"cpp", "*.mq5":"cpp" }
Extension available in the VS marketplace
https://marketplace.visualstudio.com/items?itemName=nicholishen.mql-over-cpp
- marketplace.visualstudio.com
Thanks, Ill try it :)
Very clever.
1) How to compile from mq4 to ex4 in Visual Studio Code?
2) How to run debugging mq4 in Visual Studio Code?
Thanks.
1) How to compile from mq4 to ex4 in Visual Studio Code?
2) How to run debugging mq4 in Visual Studio Code?
For 1) look in the documentation (section Compilation from the Command Line).
2) is impossible at the moment.

- www.metatrader5.com
Very clever.
1) How to compile from mq4 to ex4 in Visual Studio Code?
2) How to run debugging mq4 in Visual Studio Code?
Thanks.
I'm pumped - this editor is seriously awesome and the only real hiccup is that the c++ intellisence doesn't recognize the dot operator being used on pointers... oh well. Here is a script that compiles and outputs the results to the terminal inside of VSC using the default Build keybinding of Ctrl+Shift+B.
You'll need to create a workspace.. I created one directly in my MQL folder. Next, go to Tasks > Configure tasks and create a new tasks.json file and paste and edit the paths to your MT install. Note: this isn't ideal...
{ "version": "2.0.0", "tasks": [ { "label": "launch_metaeditor", "type": "shell", "command": "C:\\Users\\User\\Dropbox\\MT-TK\\metaeditor.exe /portable", }, { "label": "launch_terminal", "type": "shell", "command": "C:\\Users\\User\\Dropbox\\MT-TK\\terminal.exe /portable", }, { "label": "MQL4-Compile", "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "shared" }, "promptOnClose": true, "type": "shell", "command": "C:\\Users\\User\\Dropbox\\MT\\metaeditor.exe", "args": [ "/compile:${file}", "/inc:C:\\Users\\User\\Dropbox\\MT\\MQL4", "/log:${file}.log;", "type ${file}.log;", "del ${file}.log" ], } ] }
Here are some bonus keymappings to quick-launch the terminal or the meta-editor
[ { "key": "ctrl+alt+m", "command": "workbench.action.tasks.runTask", "args":"launch_metaeditor" }, { "key": "ctrl+alt+t", "command": "workbench.action.tasks.runTask", "args":"launch_terminal" }, ]
Thank you nicholishen. It works well. :-)
Thank you nicholishen. It works well. :-)
No worries... I actually ran into some issues with the compile script when working with larger projects due to the compile time. I introduced sleep into the shell command and now I don't have any issues.
{ "version": "2.0.0", "tasks": [ { "label": "launch_metaeditor", "type": "shell", "command": "C:\\Users\\User\\Desktop\\MT5-BB\\metaeditor64.exe /portable", }, { "label": "launch_terminal", "type": "shell", "command": "C:\\Users\\User\\Desktop\\MT5-BB\\terminal64.exe /portable", }, { "label": "MQL-Compile", "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "shared" }, "promptOnClose": true, "type": "shell", "command": "C:\\Users\\User\\Desktop\\MT5-BB\\metaeditor64.exe", "args": [ "/compile:${file}", "/inc:C:\\Users\\User\\Desktop\\MT5-BB\\MQL5", "/log:${file}.log;", "timeout 3;", "type ${file}.log;", "del ${file}.log" ], } ] }
No worries... I actually ran into some issues with the compile script when working with larger projects due to the compile time. I introduced sleep into the shell command and now I don't have any issues.
"timeout 3;" -- this 3 seconds is still not 100% working so I have increased to 5 seconds then it is working. I guess because I have over 3000 lines of code. 5 seconds via VS Code seems too long for me. It took 97ms via Metaeditor. Thanks.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use