What is an Expert Advisor?
- An Expert Advisor is built by creating an MQL file, with an extension of mq4, and then compiling the MQL file into Expert Advisor code.
- The extension of the Expert Advisor file is ex4.
- If the Alpari version of MetaTrader was installed on your PC, the folder “C:\Program Files\ MetaTrader - Alpari UK\experts” will contain both mq4 and ex4 files.
- The mq4 file is a human readable file.
- If you double click an mq4 file, the “MetaEditor” application will start and open the mq4 file.
- The MetaEditor application is part of the MetaTrader platform. It is automatically installed when the MetaTrader platform is installed.
- The “MetaEditor” application is used to edit MQL code. It has many useful features found in most code editors, including intelli-sense, context help and an online library.
- While editing an mq4 file from within the MetaEditor, an Expert Advisor is built by clicking the “Compile” button. If there are no syntax errors, the MetaEditor application will build the ex4 file.
- The ex4 file is not a human readable file. It is binary code interpreted by the MetaTrader platform.
- By compiling the mq4 file, you are converting the MQL language, which is human readable text, into a binary file that can be read by a machine.
- When the MetaTrader platform is started, any ex4 files in the “experts” folders are available under the “Expert Advisors” folder in the Navigator window of the MetaTrader platform.
- The VTS application converts its drawings into MQL code.
- VTS automatically creates an mq4 file and places it in the MetaTrader platform’s “experts” directory. The mq4 file is then compiled into an ex4 file using the MetaEditor application.
- Both the MetaEditor and Terminal applications can be run from within VTS when VTS is configured correctly.