Example of Project CreationThe example of creation of a simple script using MetaEditor will be described step by step in this section. Creation of Project by TemplateIt is necessary to start the MQL5 Wizard by executing the "
After that one should choose the "Script" option and press the "Next" button.
At this stage one should specify the name of the script and the information about its author and the website address. Once the "Done" button is pressed, the new file of the script will be created in the "Scripts" folder. Further it is necessary to create a separate folder for the script. To do that one should execute the "New Folder" command in the context menu of the "Navigator" window.
The next step is to move the created file of the script (ScriptExample.mq5) to the new folder using the Drag'n'Drop technology. One can start writing the source code as soon as the file is moved:
As soon as the source code is written it is necessary to save and compile it using the "
The executable file of the script ScriptExampe.ex5 will be created as a result of compilation as well, it will be placed to the same folder as the source file. One can debug the script if it is necessary. In order to do it one should place a breakpoint at the necessary line by double clicking on the grey field located to the left of the line. Then it is necessary to execute the "
As soon as it is done the script will be attached to the temporary chart in the client terminal, and the result of script execution will be displayed at the journal — the "Hello World!!!" inscription:
In order to finish debugging one should execute the " As soon as all the necessary steps are passed the script can be used in the client terminal. To open it one should execute the "
|
MetaTrader 5 — a complex trading platform for providing brokerage services on the retail Forex market.
Copyright 2000-2012, MetaQuotes Software Corp.







