How to Order a Trading Robot in MQL5 and MQL4

14 July 2010, 17:34
80 337


Automated Trading in MetaTrader

The main advantage of the MetaTrader trading terminal is the ability to create automated trading systems that can perform trading operations without the intervention of the trader, thus eliminating the influence of psychology on the results of the trade. To do this, we need to formulate a trading strategy and implement it in the form of a program in the MQL language. In addition, aside from the standard technical indicators of the market, you can create your own indicators and visualize them in the trading terminal.


Writing Trading Programs

However, not all traders are programmers, so on forums we often see posts such as "Programmer Needed." Many programmers provide such services as writing Expert Advisors and indicators in the MQL language. Writing trading Expert Advisors for others requires a certain specificity; the algorithm must be clearly formalized (see  An Expert Advisor Made to Order. Manual for a Trader), otherwise the customer might not receive what he or she expected and there may be misunderstandings.

Those on each side of the contract (the customer and the programmer who implements a solution) would wish to reduce these unpleasant factors. The programmer would like to be sure that the task will be clearly formulated, accepted and paid for on time. The customer needs the job to be done within the required time period and in the specified volume. As we know, the best advertisements are the recommendations— a lists of qualified programmers (in Russian) is periodically discussed at the forum. We tried to implement all of this in one place.


Freelance Section at

The main difference between the Freelance service at and the majority of similar resources and services on other websites is the security. The customer and the programmer are secured from each other's negligent actions throughout the whole period of joint work. In the event of a dispute, the MetaQuotes Ltd is ready to assume the role of the arbitrator.

Even if, as a customer, you have already found a programmer who is willing to take on this task, we recommend you use the new service because it provides many details that are often overlooked in the preliminary discussions. And, vice versa, if you are a programmer and you receive a proposal for writing an automated trading system, indicator or script for a specified amount of money. In order to maximally formalize your relationship with the customer and to conduct the project in a single, common standard, you can suggest to your counterpart that he or she submit the agreement as a new order into the Freelance section.

In this article, we will discuss how to use the Freelance service for placing and performing a task.


1. Creating a New Job

To place an order for the creation of an Expert Adviser, go to the Freelance section and select the New item.

Figure 1. Creating a New Job

Figure 1 Creating a new job.

After this, you will be able to specify the details of the task.

Figure 2. Editing the task

Figure 2 Editing the task.

  • Name (brief information about the task which needs to be completed).
  • Price, or estimated cost (specified in U.S. dollars).
  • Period, or tentative time-frame (specified in days).
  • Categories (specify one or two categories of the task): Indicators, Experts, Libraries, Scripts, Integration or Other.
  • Description, basic information about the task; at this stage it is not necessary to provide a detailed requirement specification.

As in any business, you must be a realist. If you specify too small of a compensation, you risk not getting any proposals for the task implementation, or getting a proposal of a low quality. If you still cannot decide on the complexity, and hence on the cost of the task, yet can postpone specifying it.

In the Categories section, you are required to specify one or two (no more) categories of the task. Once specified, click Apply.

Figure 3. Jobs Categories

Figure 3 Job categories.

In our case, you need to write an Expert Advisor, so choose the category Expert Advisor.

After this, in the New section, you will see an order for the performance of the task, and this order will be displayed in the Freelance section for all MQL5 users.

Figure 4. Placing a task order

Figure 4 Placing a task order.

The first step has been taken, now we simply have to wait for someone to take the order, and prepare for the questions related to it.


2. Processing the Orders for Executing This Job

To inform the customer about the willingness to perform the job, applicants need to apply for its implementation.

Figure 5. Placing an order for implementing the task

Figure 5 Taking part in the job.

The current orders for the task implementation are seen by all users of the When the orders are submitted by the applicants, they fall into the category of Unprocessed.

Important: keep in mind that, in your application, only the first message will be available for public view, the rest of the communication between the customer and the applicant will be kept private and accessible only to the two of them.

If there are some new messages in a job, a bag icon will appear which notifies updates in jobs.

Figure 6. Updates in jobs

Figure 6 Updates in jobs.

Click on the bag icon to see new messages.

Further actions of the customer is the processing of applications for job implementation. This is done by moving the applications into the categories Selected, Candidates, or Rejected.

Figure 7. The list of applications from Candidates for taking part in the job

Figure 7 The list of applications from job candidates.

The suitable applicants for the job can be placed into the Candidates group, and further discussions about the job's details can be held with them.

When applicants are placed into the candidates group, they are informed about this, and the following message is placed into the respective orders.

Important: try to communicate with each other as much as possible through the commentaries of the order, not only at this step, but during all subsequent stages. Often, people interpret the same exact terms in different ways. The more questions you ask each other during the process, the better quality results you will obtain.

Once the customer decides on the most appropriate applicant for the execution of the job, the application needs to be moved to the Selected category.

Figure 8. Selecting the Contractor for the job

Figure 8 Selecting the contractor for the job.

Important: when you select an additional order for the current order, the previously selected order will be removed from the selected category.

In this example, the customer Alexander_Demidov placed the orders of the users Mikhail_Antonov and Greg_Maltsev into the Candidates group. The order of the user Mikhail_Antonov will be moved to the Selected category. The transfer of the order to the Selected category indicates that the customer has chosen the contractor for the task.

It is important to note once again, that the Selected category can contain an order from only one applicant. Try to clarify all questions about the proposed job by this point; it is desirable to re-read all of the messages sent to each other, before proceeding to the next step.


3. Executing the Job

The process of executing the job consists of six steps. Passing the first five steps are confirmed by the customer and the contractor.

The last step, paying for the completed jobs, is done automatically.

A brief description of the actions of the customer and the contractor on each of the steps is provided in Table 1.

Step Name Customer's actions Contractor's actions
1 Work agreement Confirms the selection of the contractor for implementing the job. Confirms the agreement for the implementation of the job.
2 Requirements negotiation Provides the contractor with the technical specifications.
Confirms the final price and the job implementation time.
Confirms the final technical specifications, price and the job implementation time.
Demonstration Upon receiving the working materials, the customer must either confirm that the submitted materials correspond to the nature of the order, or refuse it, with a provided list of unimplemented technical specifications. When all the parameters of the technical specification have been implemented, the contractor provides a demonstration of the job and confirms that the customer is presented with a completed solution.
Work acceptance Verifies the submitted materials, and accepts the job. Provides the job to the customer, and confirms that the job has been submitted.
Payment After the acceptance of the job by the customer, the system will automatically transfer the payment from the customer's account to the contractor's account.

Table 1 The actions of the customer and the contractor for each of the steps.

The discussion of details and material exchange is produced in the messages of a particular task.

Attention! Do not forget to leave all important messages in the form of commentaries, even if you have already discussed these issues through other channels of communication, such as chat, personal messages or oral discourse. Always secure all of the agreements you have reached in the form of messages, posted directly in the commentaries.


3.1 Step 1: Work Agreement

To confirm the start of working with a specific contractor, the customer needs to move the selected order for the job implementation into the Selected category and to verify agreement to the author of the order.

Figure 9. Confirming Contractor selection

Figure 9 Confirming contractor selection.

After this, in the discussion, you will see a confirmation of the step, "Work Agreement."

Figure 10. Confirmation of the "Work Agreement" step by the Customer

Figure 10 Confirmation of the "Work Agreement" step by the customer.

After the customer's confirmation of the work agreement, the developer will receive the following push notification.

Jobs: Customer Alexander_Demidov confirmed step "Work Agreement".

To be able to receive push notifications, you need to specify a Metaquotes ID in your profile. Read more about push notifications in  MetaQuotes ID in MetaTrader mobile terminal.

Both customer and contractor will be informed with such push notifications after passing each step.

The contractor must also confirm agreement for the implementation of the job.

Figure 11. Confirmation of the "Work Agreement" step by the Contractor

Figure 11 Confirmation of the "Work Agreement" step by the contractor.

After the contractor agrees to implement the job, the working agreement is complete.

Figure 12. The "Work Agreement" step confirmed by both parties

Figure 12 The "Work Agreement" step confirmed by both parties.

As seen in Figure 11, step "Work Agreement" is now displayed by a light green color. This indicates that the step has been completed.

The customer and the contractor may continue to negotiate and discuss the details of the technical specification, the final cost and the tentative time of implementation.

Note that the customer should proceed to the next step only after the final version of the technical specifications have been approved.


3.2 Step 2: Negotiation of Requirements

The negotiation of requirements is an important step for further cooperation. Discuss all the nuances of the future solution; ask questions, even if the answers to them seem obvious. After all, the main potential problem is the lack of understanding; when one party assumes some things to be obvious and present by default, the other party may not see it that way. Therefore, certain factors may not be considered equally important by both parties, and thus not handled appropriately.

Figure 13. The requirements to the Expert Advisor

Figure 13 The requirements to the Expert Advisor.

When you discuss the requirements, you can also attach it in your comments as files with allowed extensions.

Figure 14. Attaching the Requirements while discussing the job

Figure 14 Attaching the requirements while discussing the job.

You need to establish a clear understanding of each item in the technical specifications. Do not forget to indicate in what form the provided prototypes, demonstrations and transfers of implemented jobs will be produced.

Before confirming step 2, the customer should provide a final list of requirements as an attachment. All the requirements must be specified. If necessary, the requirements can be presented using the images.

The customer must provide the final version of the technical specifications, establish the amount of the payment and the terms and deadlines of job implementation.

Figure 15. Confirmation of technical Specifications by the Customer and approving the final cost of the job

Figure 15 Confirmation of technical specifications by the customer and approving the final cost of the job.

The contractor must agree to the terms of the technical specifications and the final cost of the job.

Figure 16. Confirmation of agreement with the Technical Specifications by the Contractor and approving the final cost of the job

Figure 16 Confirmation of agreement with the technical specifications by the contractor and approving the final cost of the job.

Confirmation by both parties of the technical specifications must contain all requirements of the order.

The confirmation at the given step indicated that all jobs will be produced in full compliance with the final version of the technical specifications. No other preliminary agreements, written or oral, not described in the technical specifications, can be taken into account when evaluating an issue or complaint.

After confirmation by both parties of the "Negotiation of Requirements" step, you will see the following message in the discussions.

Figure 17. Confirming the "Negotiation of Requirements" step

Figure 17 Confirming the "Negotiation of Requirements" step.

After the completion of the "Negotiation of Requirements" step, it is impossible to make any changes to the commentaries of job discussions. In case it is necessary to make some changes, you need to send a new message with a detailed description of the necessary alteration.


3.3 Step 3: Demonstration

After agreeing on a prototype of the program, the contractor proceeds to the final implementation of the order. During the process of the job's implementation, it is desirable that the contractor continues to clarify the arising issues in the commentaries.

Once all of the requirements specified in the technical specifications have been implemented, it is time to demonstrate the finished job to the customer. The job must meet the formal requirements of the technical specifications and the prototype/model must be approved by the customer. Additional comments, which arise over the course of the job, may be rejected by the contractor if they were not discussed over the preliminary stages.

The format in which the demonstration will be produced depends on the nature of the order. For Expert Advisors, this can be the provision of test reports for a previously specified period. This may also require the provision of additional logs about the work of the Expert Advisor, on a specific demo account of a specific broker and so on. This can be an attached video, or even a video conference, or the provision of a remote access to the contractor's terminal on which the finished program can be executed.

All of the demonstration stages should also be reflected in the commentaries to the order, where the customer can ask questions with attached screenshots, and the contractor can respond to them. The purpose of the demonstration and its discussion is to ensure the customer that the ordered job has been done properly, and in the agreed upon volume.

After the demonstration has been produced, the customer must either confirm that the submitted materials satisfy the nature of the order, or refuse it, providing a list of unimplemented requirements of the technical specifications. If necessary, the contractor takes a little time to correct the identified deficiencies, and produces a new demonstration.

The process of validation of the "Demonstration" step is also automatically recorded by the Freelance service.

Figure 19. Confirming the "Demonstration" step

Figure 19 Confirming the "Demonstration" step.

If in the course of working on an order, there is a deviation from the requirements of the technical specifications, then the customer or the contractor may appeal to the arbitrator to resolve the situation.


3.4 Step 4: Work Acceptance

The contractor finally passes to the customer all the materials on the implemented job, in the specified volume. Typically, the solution is transferred in its source code, since the version of the compiler may change in the future, which will require recompiling the solution. If for some reason the source code is not transferred, and only the compiled execution code is available, then the issue of future updates should be addressed at the stage of technical specifications preparation. Issues related to solution updates are not handled by the administration of the jobs resources, and can not be presented for appeal to the arbitrator.

The questions of further usage of the code in other developments, by the customer or the contractor, as well as the rights to distribution to third parties on paid or free bases, should also be addressed in the technical specifications, and also can not be raised before the arbitrator after the transfer is complete. The administration of the Freelance section does not have the ability to track down the execution of such requests, and the best guarantee for both parties in such cases is their personal reputation.

The fact of the transfer of implemented jobs must be reflected in the commentaries, where you should describe in detail the way that the transfer has been implemented. If the job is transferred via email, the contractor should indicate this in the commentaries and specify when, and to what mailbox, the job should be sent. The customer, in turn, confirms the receipt of such letter and indicates the time it was received. Even if the transfer is implemented right in the commentaries to the order, it should still be mentioned in that commentary that the contractor is transferring the final solution, in full accordance to the technical specifications.

After the materials have been transferred, the contractor waits for the confirmation of receipt by the customer. If the customer does not write any commentaries to the order about any issues arising with the job or does not engage in any type of communication in the three days following when the contractor confirms the transfer, then the job is considered accepted automatically.

Figure 20. Confirming the "Work Agreement" step

Figure 20 Confirming the "Work Agreement" step.

If in the course of working on an order, there is a deviation from the requirements of the technical specifications, the customer or the contractor may appeal to the arbitrator in order to resolve the situation.


3.5 Step 5: Payment

After the "Work Acceptance" step has been done, the job is considered completed, and the payment for it will automatically be transferred from the customer's account to the contractor's account. No actions from the customer are required to implement the payment.

Figure 21. Job payment

Figure 21 Job payment.

After its completion, the job is transferred to the "Completed" section.

Figure 22. Job is complete

Figure 22 Job is complete.


4. Feedback About the Job

After the completion of the job, the customer and the contractor have the opportunity to write feedback about the working cooperation and assign it a quality rank.

The list of jobs, completed by the customer or the contractor, can be found in the Freelance section of the user's profile.

An example of feedback, posted by a customer, is presented in Figure 23 following.

Figure 23. The list of jobs completed by Mikhail Antonov

Figure 23 The list of jobs completed by Mikhail Antonov.

The contractor also can post his feedback about the finished job.

Figure 24. Feedback from the job Contractors hired by Alexander Demidov

Figure 24 Feedback from the contractors hired by Alexander Demidov.



If you are a trader with a ready-made trading strategy, but do not know how to program in MQL5/MQL4, then the Freelance service is perfect for you. With this service, you will obtain a simple, controllable and safe opportunity to find the right developer who will write an Expert Advisor or an indicator for you. Any registered user can accept your offer and develop the desired program for you.

With the launch of the "Freelance" service, the became an ideal place for placing orders and providing programming services. Thousands of traders and developers visit this resource on a daily basis and can easily help each other. For traders, the Freelance service is the opportunity to easily obtain their own Expert Advisors. For MQL5-developers, it is an opportunity to easily find clients.

Translated from Russian by MetaQuotes Software Corp.
Original article:

Last comments | Go to discussion (14)
flavio passerini
flavio passerini | 21 May 2015 at 22:59
I m new on this experience. I almost finished the steps for a new job to order. We both agree but there is a message telling " not enough money to pay" but I have much more than the 30usd on my account.  Do I have to open a special account to pay. In wich way do I open this account?
Alain Verleyen
Alain Verleyen | 22 May 2015 at 12:21


Is there a way to update the original job posting after it is in the in progress mode?

I wasn't able to find the option to do this.

Thank you.

Of course not.
EricForex | 26 Oct 2015 at 04:21

A selected candidate was not able to agree on requirements and now I need to select another, but the other candidate does not have a 'select' option.   I'm able to move him to candidates but will not allow me to select.

What can I do? 


johnny global
johnny global | 5 Mar 2016 at 16:07


The following project is NOT working out with the programmer.

How do I cancel?



The project started mid January.... to date I havent received anything!


Ramani457635 KASSIGNIN
Ramani457635 KASSIGNIN | 6 Feb 2020 at 21:09
Bonsoir les membres je suis nouveau sur la plateforme et ça me vaut beaucoup de choses pour moi que je n'es pas encore maîtriser svp aidez moi  a pris le goût de trading online 
Merci beaucoup
Writing an Expert Advisor Using the MQL5 Object-Oriented Programming Approach Writing an Expert Advisor Using the MQL5 Object-Oriented Programming Approach

This article focuses on the object oriented approach to doing what we did in the article "Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners" - creating a simple Expert Advisor. Most people think this is difficult, but I want to assure you that by the time you finish reading this article, you will be able to write your own Expert Advisor which is object oriented based.

Functions for Money Management in an Expert Advisor Functions for Money Management in an Expert Advisor

The development of trading strategies primarily focuses on searching for patterns for entering and exiting the market, as well as maintaining positions. If we are able to formalize some patterns into rules for automated trading, then the trader faces the question of calculating the volume of positions, the size of the margins, as well as maintaining a safe level of mortgage funds for assuring open positions in an automated mode. In this article we will use the MQL5 language to construct simple examples of conducting these calculations.

The Principles of Economic Calculation of Indicators The Principles of Economic Calculation of Indicators

Calls to user and technical indicators takes up very little space in the program code of automated trading systems. Often it’s simply a few code lines. But it often happens that it is these few lines of code which use up the largest portion of time, which needs to be spent on testing the Expert Advisor. Therefore, everything that is related to data calculations within an indicator, needs to be considered much more thoroughly than would seem at first glance. This article will talk precisely about this.

A Library for Constructing a Chart via Google Chart API A Library for Constructing a Chart via Google Chart API

The construction of various types of diagrams is an essential part of the analyses of the market situation and the testing of a trading system. Frequently, in order to construct a nice looking diagram, it is necessary to organize the data output into a file, after which it is used in applications such as MS Excel. This is not very convenient and deprives us of the ability to dynamically update the data. Google Charts API provided the means for creating charts in online modes, by sending a special request to the server. In this article we attempt to automate the process of creating such a request and obtaining a chart from the Google server.