This simple application shows you how to write your own extension for metatrader (EA, indicator, library) in JAVA. The JAVA code is executed in a virtual machine which runs inside the terminal.exe (MT4) process.
- java folder
Contains a sample eclipse project with a simple EA implemenation in JAVA.
- mt4 folder
Contains the MT4 EA code, which calls the JAVA implementation.
- vc folder
Contains a Visual Studio project with the sources for the MT4 Java connector.
-
Copy the experts folder from your mt4 source folder to your Metatrader installation directory
-
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 /exterts/libraries
-
Open the eclipse project and export the project as JAR file.
-
Copy the JAR file to /exterts/libraries
-
Edit JVM configuration file /exterts/libraries/mt4j.properties and adjust the path to your JVM dll and your JAR file.
-
Restart MT4. In the navigator panel under "Experts" you should now see the mt4jSample EA