MetaEditor Hilfe

Creating Scripts

Creating Scripts

An Expert Advisor template is a file designed for writing a source code. After it has been created, it is automatically placed in an MQL5/Scripts (or MQL4/Scripts) directory.

After choosing the corresponding position in the MQL4/MQL5 Wizard and pressing the "Next" button the following window appears:

Creation of Script

The following fields should be filled out in this window:

  • Name — the name of the script, the same name will be given to its file;
  • Author — the name of the author;
  • Link — the e-mail or website address of the developer;
  • Parameters — a set of input parameters (external variables) of the script.

Variables of the "input" class refer to external parameters. In order to create a parameter one should press the "Add" button. There are three fields that should be filled out in the appeared entry:

  • Name — the name of the input variable;
  • Type — the type of the input variable chosen from the list;
  • Initial Value — the initial value of the variable that will be used on default before it is changed manually.

Once all the necessary fields are filled out, the "Done" button will become active. As soon as it is pressed, the project of the script will be created and the window for writing its source code will be opened automatically.