MetaEditor Hilfe

Projects

Projects

MetaEditor provides convenient functionality for working with large projects, allowing users to combine files into a single structure, manage project settings and develop applications in teams via the online MQL5 Storage repository with version control.

What is a project?

A project is a separate file with the MQPROJ extension, which stores program settings, compilation parameters and information about all files used in the project. A separate tab in the Navigator is provided for a convenient work with the project. All files, such as include, resource, header and other files are arranged into categories on this tab.

Project Structure and Settings

Creating a Project

Creation of a new project is as easy as the creation of a normal MQL5 program. Click "New Project" and select the type of the desired program in the MQL5 Wizard:

Creating a new project

Then complete standard MQL5 Wizard steps: set the type, name and properties of the desired program, as well as select appropriate event handlers.

Creating a Project Based on an MQ5 File

If you already have developments in the form of MQ5 files, you can easily transform them to a project. Select a file and click "New project from sourceNew Project from Source" in the file context menu:

Creating a new project based on the source file

A new project file with the same name and the mqproj extension will be created in the directory where the selected file is located. The main program properties specified in the source code via #property will be automatically added to the project, including the name, copyright, version, link to the developer's site and program description. All files included in the source code through the #include directive will be added to the "Dependencies" section of the project.

Project Properties

Main project settings can be accessed from a separate dialog box instead of editing the source code as it is normally done in separate MQ5 files. To open project settings click "Project PropertiesProperties" in the project context menu. The following project settings are available:

  • Platform means the platform version for which the project is developed, i.e. MetaTrader 4 or MetaTrader 5.
  • Program type: Expert Advisor, Indicator, Script or Library.
  • Copyright shows copyright information similar to "#property copyright ..." in the source code.
  • Link shows the link to a developer's site similar to "#property link ..." in the source code.
  • Version: specifying the version of the program similar to "#property version ..." in the source code.
  • Icon: the icon of the program similar to "#property icon ..." in the source code.
  • Description: program description similar to "#property description ..." in the source code.
  • Enable additional optimization: applications with the optimization disabled are compiled faster, but execute more slowly.
  • Check floating point dividers: applications with the check disabled work a little faster, because the zero divide error is not checked during code execution.

The set of program properties in the project file is given a higher priority, than properties specified in the program code. If properties are specified both in the project and in the source file, properties from the project will be used.

Adding and Removing Files from a Project

All files used in the source code are added to the project navigator automatically. For example, if you include a new MQH file using the #include directive, it will automatically appear in the "Dependencies" section of the navigator. Used header files are added to the Headers section; images, sounds and other MQL programs used in the project as resources (via the #resource directive) are added to the Resources section.

MQ5 files with the source code are displayed in the Sources section. Other files, such as set files for testing and chart templates, can be added to the "Settings and files" section.

Use context menu commands to add existing files to a project or to delete files from it. Be careful when deleting files, since you can remove a file from the project (remove the binding) or completely delete it from the hard disk:

Adding and Removing Files from a Project

A file added to the project manually is not included to the program code and is not copied to the project directory. The file is only linked to the project to be displayed in its navigator.

Compiling a Project

To compile an executable EX5 file, open the project or the main MQ5 file of the program, and then run the compiler command (F7). The resulting executable file will be created in the same directory, where the project file MQPROJ is located.

Group Projects

MetaEditor allows programmers to remotely develop MQL5 applications in teams. The MQL5 Storage online repository is integrate into the editor:

  • Version supports allows you to see all changes made to the project and revert them if necessary.
  • Online access to the project ensures access for all project members from any computer, using the MQL5.community.
  • You can grant separate rights to project participants, allowing to view or to edit the project.
  • You can also create public projects, which are visible to all users. Public projects are displayed in a separate tab in MetaEditor, from which anyone can apply for participation.

Shared projects are managed from a separate Shared Projects section. If you have not connected the storage yet, execute the 'Activate MQL5 Storage' command from the context menu of the desired folder. MetaEditor will check if your storage contains any saved data and if there are any share projects available to you. All available data will be retrieved from the storage and uploaded to your computer. Available group projects appear in the Shared Projects section. To retrieve the projects, execute "Checkout from Storage" in the context menu.

To create a new group project, select the Shared Projects folder and click "New Project":

Creating a Shared Project

Then complete standard MQL5 steps: set the type, name and properties of the desired program. For group projects, you should use clear and understandable names, so that other participants could easily find them. Only Latin letters and numbers without spaces can be used in project names.

A created project is immediately added to the MQL5 Storage. Standard Library files used in the project are not added to the storage, and you can add them manually.

To allow other participants to work with the project, open the project properties. You can grant permissions to selected users and set general parameters for the team work:

  • A private project is only available to the author
  • A free to join project allows anyone to join it
  • A join by request project can be accessed after sending a request to the author

Configuring Access to the Shared Project

To grant permissions to a selected user, click on "add a new user" and specify the MQL5.community login of this user. Then select permissions:

  • Read: the user can see the project data and will be able to download to his or her MetaEditor.
  • Read and Write: the user can see the project data, as well as upload his or her own changes to the Storage, but cannot change the list of participants.

When you compile a group project, the executable EX5 file is automatically copied to the local Experts, Indicators or Scripts directory depending on the program type. It allows you to instantly run the program in the terminal without having to copy it manually to the proper directory.

Public Projects

Each shared project in MQL5 Storage has publicity settings: the project can be private or open to other users. All projects that you can join are displayed in the separate "Public Projects" tab.

Public Projects

Click Join in order to join a project. After that the project will appear in the Shared Projects section. Then click "Update from StorageUpdate from Storage" in the context menu of the project in order to download it to your computer.

Each joined user gets read-only rights. Contact the project author to be able to submit your changes. To know his or her MQL5.community login, open the project properties via the context menu:

Viewing project properties