A Sublime Text 3 plugin for building MetaTrader's MQL projects on a Linux system.
Sublime Text 3.x
Wine - Windows compatibility software
smbclient - if Metatrader is running on a Windows machine
Metatrader 4/5 - www.metatrader.com
Copy the MQL5Comp.sublime-package
from this repo's build directory into your Sublime Text "Installed Packages" location.
It should be at ~/.config/sublime-text-3/Installed Packages/
or
Clone MQL5Comp:
git clone https://github.com/curvian/MQL5Comp
Create package dir & copy contents of MQL5Comp/src into it:
mkdir ~/.config/sublime-text-3/Packages/MQL5Comp
cp -r MQL5Comp/src/* ~/.config/sublime-text-3/Packages/MQL5Comp
or
Install with Package Manager (Not yet available)
It is important to get the directory structure right for the project.
Inside your sublime project directory must exist a source directory with any name of your choice ("src", or "my_expert", anything) and specified in your .sublime-project
file, along with all the other settings.
From there a specific structure must be maintained for the metatrader compiler to work correctly, and for the files to be installed/copied correctly.
- Create your project directory structure as follows:
MyExpertProject/
MyExpert.sublime-project
MyExpertSource/
metaeditor.exe
MQL4/
Experts/
MyExpert.mq4
Indicators/
Scripts/
Include/
Libraries/
-
Copy your compiler (metaeditor.exe, for instance) from the Metatrader program on Windows to the root of your source directory, as shown above.
-
From this repo, in the support directory, open
example.sublime-project
Read the comments inside and copy the relevant settings to your ownMyProject.sublime-project
file. -
Make sure to create the windows share of your Metatrader application data or program root (depending where your data is located) This will make sense when you edit your project file settings as specified in
example.sublime-project
If all is set up correctly, all you have to do is hit ctrl+B to build the current mq4 file open in Sublime Text.
The first time MQL5Comp build command is run it will check for the relevant drive mapping in wine and create it if it does not exist.
After a successful build, the compiled ex4 file can be found in the relevant Experts
, Scripts
, or Indicators
directory on your
target machine (smb or local) running Metatrader platform (as well as in your source location) and should be loadable as usual.
See support/dev/ location for simple plugin development helpers
Sometimes when running build for first time on new project, the wine message "wine is being updated" hangs/does not complete. Kill the process and try again. Should be fine from there.