MetaEditor HelpArticles on the development of trading applications

Articles on the development of trading applications

MQL5.community website features an extensive library of articles on MQL4/MQL5 programming. Articles are an excellent guide for creating applications, since they cover a lot of practical tasks involving algorithmic trading. New articles are published every week.

The list of all available articles is displayed directly in MetaEditor. To find the necessary material, use the online search.

Articles on MQL4/MQL5 programming

Recommended articles for beginners

Fast dive into MQL5

Fast dive into MQL5

You have decided to study MQL5 trading strategies' programming language, but you know nothing about it? We have tried to examine MQL5 and MetaTrader 5 terminal from the newcomers' point of view and have written this short introductory article. In this article, you can find a brief idea of the possibilities of the language, as well as some tips on working with MetaEditor 5 and the terminal.

MQL5: Create your own indicator

MQL5: Create your own indicator

What is an indicator? It is a set of calculated values that we want to be displayed on the screen in a convenient way. Sets of values are represented in programs as arrays. Thus, creation of an indicator means writing an algorithm that handles some arrays (price arrays) and records results of handling to other arrays (indicator values). The article tackles writing indicators in MQL5 using the development of True Strength Index indicator as an example.

Applying one indicator to another

Applying one indicator to another

When writing an indicator that uses the short form of the OnCalculate() function call, you might miss the fact that an indicator can be calculated not only by price data, but also by data of some other indicator (no matter whether it is a built-in or custom one). Do you want to improve an indicator for its correct application to the other indicator's data? In this article we'll review all the steps required for such modification and outline additional rules for correct creation of such an indicator.

The order of object creation and destruction in MQL5

The order of object creation and destruction in MQL5

Each object, be it a custom object, a dynamic array or an array of objects, has its own creation and destruction features in an MQL5 program. Some objects are often part of other objects, and the order of destruction of objects at the time of deinitialization becomes particularly important. This article provides several examples for understanding the mechanisms of working with objects.

Using the object pointers in MQL5

Using the object pointers in MQL5

By default, all MQL5 objects are passed by reference, but it is possible to use object pointers. This may cause obtaining an uninitialized object pointer as a function parameter. In this case, the program operation is completed critically with subsequent unloading. Automatically created objects usually do not cause such an error, and in this respect they are quite safe. In this article, we try to figure out what the difference between a reference and pointers is, when it is justified to use pointers and how to write safe code applying pointers.

Trade operations in MQL5 – It's easy

Trade operations in MQL5 – It's easy

Almost all traders come to market to make money but some traders also enjoy the process itself. However, it is not only manual trading that can provide you with an exciting experience. Automated trading systems development can also be quite absorbing. Creating a trading robot can be as interesting as reading a good mystery novel.

The algorithm of ticks' generation within the strategy tester of the MetaTrader 5 terminal

The algorithm of ticks' generation within the strategy tester of the MetaTrader 5 terminal

MetaTrader 5 allows us to simulate automatic trading, within an embedded strategy tester, by using Expert Advisors and the MQL5 language. This type of simulation is called testing of Expert Advisors, and can be implemented using multithreaded optimization, as well as simultaneously on a number of instruments. In order to provide a thorough testing, a generation of ticks based on the available minute history, needs to be performed. This article provides a detailed description of the algorithm, by which the ticks are generated for the historical testing in the MetaTrader 5 client terminal.

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.

MQL5 Wizard: New version

MQL5 Wizard: New version

The article describes the features implemented in the new version of the MQL5 Wizard. Changes in the signals architecture allow you to create trading robots based on a combination of different market models. A specific example is used to analyze the interactive development of a ready-made expert.

Orders, positions and deals in MetaTrader 5

Orders, positions and deals in MetaTrader 5

Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it is necessary to have a good understanding of the interaction between the MQL5 program and the client terminal.

Creating and testing custom symbols in MetaTrader 5

Creating and testing custom symbols in MetaTrader 5

Creating custom symbols pushes the boundaries in the development of trading systems and financial market analysis. Now traders are able to plot charts and test trading strategies on an unlimited number of financial instruments.

Trade events in MetaTrader 5

Trade events in MetaTrader 5

A monitoring of the current state of a trade account implies controlling open positions and orders. Before a trade signal becomes a deal, it should be sent from the client terminal as a request to the trade server, where it will be placed in the order queue awaiting to be processed. Accepting a request by the trade server, deleting it as it expires or conducting a deal on its basis - all those actions are followed by trade events; and the trade server informs the terminal about them.

Use of resources in MQL5

Use of resources in MQL5

MQL5 programs not only automate routine calculations, but also can create a full-featured graphical environment. The functions for creating truly interactive controls are now virtually as rich, as those in classic programming languages. If you want to write a full-fledged stand-alone program in MQL5, use resources in them. Programs with resources are easier to maintain and distribute.

The fundamentals of testing in MetaTrader 5

The fundamentals of testing in MetaTrader 5

What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "opening price only" mode? This article aims to provide answers to these and many other questions.

The checks a trading robot must pass before publication in the Market

The checks a trading robot must pass before publication in the Market

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. It also shows how to self-test a product before sending it to the Market.

How to quickly develop and debug a trading strategy

How to quickly develop and debug a trading strategy

Scalping automatic systems are rightfully regarded the pinnacle of algorithmic trading, but at the same time their code is the most difficult to write. In this article we will show how to build strategies based on analysis of incoming ticks using the built-in debugging tools and visual testing. Developing rules for entry and exit often require years of manual trading. But with the help of MetaTrader 5, you can quickly test any such strategy on real history.