With this post we begin a basic course on MQL4 / MQL5 and we will provide you the basics of the language used to create Expert Advisors for the most used trading platform. In this first lesson we will see how to create a simple program (the classic Hello World program!) Uuing the wizard in the MetaEditor, the programming environment associated with each Metatrader 4/5 platform.
Hello world is the classic example program used to show the functionality of a programming language for beginners and we don’t break the tradition and we will start from that. To start we can exploit the tools that the programming environment makes available, that is the wizard that allows us to create the structure of the code by creating a template. We will see how is made the template generated by the wizard that we can use as a starting point and add the required functionality.
When we write an expert advisor, we write the source code through a specific language (in our case MQL4 / MQL5). The code of a program can be considered the project of the program and the language used is a language more understandable to the man than to the PC. This latter work with the translated version in machine language of our source code whereby we translate the code by a further operation, ie the compilation of the code. This operation allows us to pass from the code (file .mql4 or .mql5) to the executable (file .ex4 or .ex5). We will then see how simple it is to complete the compilation.
Finally, once the compiled program has been obtained, it must be executed. The last step is to see how to launch the file obtained on the MetaTrader. All the operations are made simple by a programming environment. In this first lesson we will look at the basic functionalities and then we will also look into some interesting aspects recently added which makes MetaEditor similar to professional development environments.