This simple application shows you how to write your own extension for Metatrader 4 (EA, indicator, library) in Java. The Java code is executed in a virtual machine which runs inside the terminal.exe (MT4) process.
Contains a sample eclipse project with a simple EA Java implemenation.
Contains the MT4 code.
Contains a Visual Studio project with the sources for the MT4 Java connector.
Copy the folders from the mql4 source folder to your MT Terminal data directory.
e.g. %APPDATA%\MetaQuotes\Terminal\
Open Visual Studio project and build (F7) DLL. Important: Please check the path for your Java SDK installation (Project settings -> VC++ directories - Include directories)
Copy DLL to your Metatrader installation directory
Open the eclipse project and export the project as JAR file.
Copy the JAR file to
Edit JVM configuration file
Restart MT4. In the navigator panel under "Experts" you should now see the mt4jSample EA