Articles on the MQL5 programming and use of trading robots

icon

Expert Advisors created for the MetaTrader platform perform a variety of functions implemented by their developers. Trading robots can track financial symbols 24 hours a day, copy deals, create and send reports, analyze news and even provide specific custom graphical interface.

The articles describe programming techniques, mathematical ideas for data processing, tips on creating and ordering of trading robots.

Add a new article
latest | best
Learn how to design a trading system by Momentum
Learn how to design a trading system by Momentum

Learn how to design a trading system by Momentum

In my previous article, I mentioned the importance of identifying the trend which is the direction of prices. In this article I will share one of the most important concepts and indicators which is the Momentum indicator. I will share how to design a trading system based on this Momentum indicator.
Learn how to design a trading system by RSI
Learn how to design a trading system by RSI

Learn how to design a trading system by RSI

In this article, I will share with you one of the most popular and commonly used indicators in the world of trading which is RSI. You will learn how to design a trading system using this indicator.
Learn how to design a trading system by Envelopes
Learn how to design a trading system by Envelopes

Learn how to design a trading system by Envelopes

In this article, I will share with you one of the methods of how to trade bands. This time we will consider Envelopes and will see how easy it is to create some strategies based on the Envelopes.
Developing a trading Expert Advisor from scratch
Developing a trading Expert Advisor from scratch

Developing a trading Expert Advisor from scratch

In this article, we will discuss how to develop a trading robot with minimum programming. Of course, MetaTrader 5 provides a high level of control over trading positions. However, using only the manual ability to place orders can be quite difficult and risky for less experienced users.
preview
An Analysis of Why Expert Advisors Fail

An Analysis of Why Expert Advisors Fail

This article presents an analysis of currency data to better understand why expert advisors can have good performance in some regions of time and poor performance in other regions of time.
Learn how to design a trading system by Bollinger Bands
Learn how to design a trading system by Bollinger Bands

Learn how to design a trading system by Bollinger Bands

In this article, we will learn about Bollinger Bands which is one of the most popular indicators in the trading world. We will consider technical analysis and see how to design an algorithmic trading system based on the Bollinger Bands indicator.
preview
Matrices and vectors in MQL5

Matrices and vectors in MQL5

By using special data types 'matrix' and 'vector', it is possible to create code which is very close to mathematical notation. With these methods, you can avoid the need to create nested loops or to mind correct indexing of arrays in calculations. Therefore, the use of matrix and vector methods increases the reliability and speed in developing complex programs.
Learn how to design different Moving Average systems
Learn how to design different Moving Average systems

Learn how to design different Moving Average systems

There are many strategies that can be used to filter generated signals based on any strategy, even by using the moving average itself which is the subject of this article. So, the objective of this article is to share with you some of Moving Average Strategies and how to design an algorithmic trading system.
Advanced EA constructor for MetaTrader - botbrains.app
Advanced EA constructor for MetaTrader - botbrains.app

Advanced EA constructor for MetaTrader - botbrains.app

In this article, we demonstrate features of botbrains.app - a no-code platform for trading robots development. To create a trading robot you don't need to write any code - just drag and drop the necessary blocks onto the scheme, set their parameters, and establish connections between them.
preview
Learn Why and How to Design Your Algorithmic Trading System

Learn Why and How to Design Your Algorithmic Trading System

This article shows the basics of MQL for beginners to design their Algorithmic trading system (Expert Advisor) through designing a simple algorithmic trading system after mentioning some basics of MQL5
preview
Fix PriceAction Stoploss or Fixed RSI (Smart StopLoss)

Fix PriceAction Stoploss or Fixed RSI (Smart StopLoss)

Stop-loss is a major tool when it comes to money management in trading. Effective use of stop-loss, take profit and lot size can make a trader more consistent in trading and overall more profitable. Although stop-loss is a great tool, there are challenges that are encountered when being used. The major one being stop-loss hunt. This article looks on how to reduce stop-loss hunt in trade and compare with the classical stop-loss usage to determine its profitability.
Better Programmer (Part 07): Notes on becoming a successful freelance developer
Better Programmer (Part 07): Notes on becoming a successful freelance developer

Better Programmer (Part 07): Notes on becoming a successful freelance developer

Do you wish to become a successful Freelance developer on MQL5? If the answer is yes, this article is right for you.
preview
Programming a Deep Neural Network from Scratch using MQL Language

Programming a Deep Neural Network from Scratch using MQL Language

This article aims to teach the reader how to make a Deep Neural Network from scratch using the MQL4/5 language.
preview
Dealing with Time (Part 1): The Basics

Dealing with Time (Part 1): The Basics

Functions and code snippets that simplify and clarify the handling of time, broker offset, and the changes to summer or winter time. Accurate timing may be a crucial element in trading. At the current hour, is the stock exchange in London or New York already open or not yet open, when does the trading time for Forex trading start and end? For a trader who trades manually and live, this is not a big problem.
Patterns with Examples (Part I): Multiple Top
Patterns with Examples (Part I): Multiple Top

Patterns with Examples (Part I): Multiple Top

This is the first article in a series related to reversal patterns in the framework of algorithmic trading. We will begin with the most interesting pattern family, which originate from the Double Top and Double Bottom patterns.
Better Programmer (Part 02): Stop doing these 5 things to become a successful MQL5 programmer
Better Programmer (Part 02): Stop doing these 5 things to become a successful MQL5 programmer

Better Programmer (Part 02): Stop doing these 5 things to become a successful MQL5 programmer

This is the must read article for anyone wanting to improve their programming career. This article series is aimed at making you the best programmer you can possibly be, no matter how experienced you are. The discussed ideas work for MQL5 programming newbies as well as professionals.
Graphics in DoEasy library (Part 76): Form object and predefined color themes
Graphics in DoEasy library (Part 76): Form object and predefined color themes

Graphics in DoEasy library (Part 76): Form object and predefined color themes

In this article, I will describe the concept of building various library GUI design themes, create the Form object, which is a descendant of the graphical element class object, and prepare data for creating shadows of the library graphical objects, as well as for further development of the functionality.
Graphics in DoEasy library (Part 75): Methods of handling primitives and text in the basic graphical element
Graphics in DoEasy library (Part 75): Methods of handling primitives and text in the basic graphical element

Graphics in DoEasy library (Part 75): Methods of handling primitives and text in the basic graphical element

In this article, I will continue the development of the basic graphical element class of all library graphical objects powered by the CCanvas Standard Library class. I will create the methods for drawing graphical primitives and for displaying a text on a graphical element object.
Graphics in DoEasy library (Part 74): Basic graphical element powered by the CCanvas class
Graphics in DoEasy library (Part 74): Basic graphical element powered by the CCanvas class

Graphics in DoEasy library (Part 74): Basic graphical element powered by the CCanvas class

In this article, I will rework the concept of building graphical objects from the previous article and prepare the base class of all graphical objects of the library powered by the Standard Library CCanvas class.
Graphics in DoEasy library (Part 73): Form object of a graphical element
Graphics in DoEasy library (Part 73): Form object of a graphical element

Graphics in DoEasy library (Part 73): Form object of a graphical element

The article opens up a new large section of the library for working with graphics. In the current article, I will create the mouse status object, the base object of all graphical elements and the class of the form object of the library graphical elements.
Other classes in DoEasy library (Part 72): Tracking and recording chart object parameters in the collection
Other classes in DoEasy library (Part 72): Tracking and recording chart object parameters in the collection

Other classes in DoEasy library (Part 72): Tracking and recording chart object parameters in the collection

In this article, I will complete working with chart object classes and their collection. I will also implement auto tracking of changes in chart properties and their windows, as well as saving new parameters to the object properties. Such a revision allows the future implementation of an event functionality for the entire chart collection.
Other classes in DoEasy library (Part 71): Chart object collection events
Other classes in DoEasy library (Part 71): Chart object collection events

Other classes in DoEasy library (Part 71): Chart object collection events

In this article, I will create the functionality for tracking some chart object events — adding/removing symbol charts and chart subwindows, as well as adding/removing/changing indicators in chart windows.
Swaps (Part I): Locking and Synthetic Positions
Swaps (Part I): Locking and Synthetic Positions

Swaps (Part I): Locking and Synthetic Positions

In this article I will try to expand the classic concept of swap trading methods. I will explain why I have come to the conclusion that this concept deserves special attention and is absolutely recommended for study.
Other classes in DoEasy library (Part 69): Chart object collection class
Other classes in DoEasy library (Part 69): Chart object collection class

Other classes in DoEasy library (Part 69): Chart object collection class

With this article, I start the development of the chart object collection class. The class will store the collection list of chart objects with their subwindows and indicators providing the ability to work with any selected charts and their subwindows or with a list of several charts at once.
Other classes in DoEasy library (Part 68): Chart window object class and indicator object classes in the chart window
Other classes in DoEasy library (Part 68): Chart window object class and indicator object classes in the chart window

Other classes in DoEasy library (Part 68): Chart window object class and indicator object classes in the chart window

In this article, I will continue the development of the chart object class. I will add the list of chart window objects featuring the lists of available indicators.
preview
Neural networks made easy (Part 13): Batch Normalization

Neural networks made easy (Part 13): Batch Normalization

In the previous article, we started considering methods aimed at improving neural network training quality. In this article, we will continue this topic and will consider another approach — batch data normalization.
Other classes in DoEasy library (Part 67): Chart object class
Other classes in DoEasy library (Part 67): Chart object class

Other classes in DoEasy library (Part 67): Chart object class

In this article, I will create the chart object class (of a single trading instrument chart) and improve the collection class of MQL5 signal objects so that each signal object stored in the collection updates all its parameters when updating the list.
Other classes in DoEasy library (Part 66): MQL5.com Signals collection class
Other classes in DoEasy library (Part 66): MQL5.com Signals collection class

Other classes in DoEasy library (Part 66): MQL5.com Signals collection class

In this article, I will create the signal collection class of the MQL5.com Signals service with the functions for managing signals. Besides, I will improve the Depth of Market snapshot object class for displaying the total DOM buy and sell volumes.
preview
Neural networks made easy (Part 12): Dropout

Neural networks made easy (Part 12): Dropout

As the next step in studying neural networks, I suggest considering the methods of increasing convergence during neural network training. There are several such methods. In this article we will consider one of them entitled Dropout.
Prices in DoEasy library (Part 64): Depth of Market, classes of DOM snapshot and snapshot series objects
Prices in DoEasy library (Part 64): Depth of Market, classes of DOM snapshot and snapshot series objects

Prices in DoEasy library (Part 64): Depth of Market, classes of DOM snapshot and snapshot series objects

In this article, I will create two classes (the class of DOM snapshot object and the class of DOM snapshot series object) and test creation of the DOM data series.
Self-adapting algorithm (Part IV): Additional functionality and tests
Self-adapting algorithm (Part IV): Additional functionality and tests

Self-adapting algorithm (Part IV): Additional functionality and tests

I continue filling the algorithm with the minimum necessary functionality and testing the results. The profitability is quite low but the articles demonstrate the model of the fully automated profitable trading on completely different instruments traded on fundamentally different markets.
preview
Useful and exotic techniques for automated trading

Useful and exotic techniques for automated trading

In this article I will demonstrate some very interesting and useful techniques for automated trading. Some of them may be familiar to you. I will try to cover the most interesting methods and will explain why they are worth using. Furthermore, I will show what these techniques are apt to in practice. We will create Expert Advisors and test all the described techniques using historic quotes.
preview
Neural networks made easy (Part 11): A take on GPT

Neural networks made easy (Part 11): A take on GPT

Perhaps one of the most advanced models among currently existing language neural networks is GPT-3, the maximal variant of which contains 175 billion parameters. Of course, we are not going to create such a monster on our home PCs. However, we can view which architectural solutions can be used in our work and how we can benefit from them.
Prices in DoEasy library (part 62): Updating tick series in real time, preparation for working with Depth of Market
Prices in DoEasy library (part 62): Updating tick series in real time, preparation for working with Depth of Market

Prices in DoEasy library (part 62): Updating tick series in real time, preparation for working with Depth of Market

In this article, I will implement updating tick data in real time and prepare the symbol object class for working with Depth of Market (DOM itself is to be implemented in the next article).
Self-adapting algorithm (Part III): Abandoning optimization
Self-adapting algorithm (Part III): Abandoning optimization

Self-adapting algorithm (Part III): Abandoning optimization

It is impossible to get a truly stable algorithm if we use optimization based on historical data to select parameters. A stable algorithm should be aware of what parameters are needed when working on any trading instrument at any time. It should not forecast or guess, it should know for sure.
preview
Practical application of neural networks in trading (Part 2). Computer vision

Practical application of neural networks in trading (Part 2). Computer vision

The use of computer vision allows training neural networks on the visual representation of the price chart and indicators. This method enables wider operations with the whole complex of technical indicators, since there is no need to feed them digitally into the neural network.
preview
Neural networks made easy (Part 10): Multi-Head Attention

Neural networks made easy (Part 10): Multi-Head Attention

We have previously considered the mechanism of self-attention in neural networks. In practice, modern neural network architectures use several parallel self-attention threads to find various dependencies between the elements of a sequence. Let us consider the implementation of such an approach and evaluate its impact on the overall network performance.
Developing a self-adapting algorithm (Part II): Improving efficiency
Developing a self-adapting algorithm (Part II): Improving efficiency

Developing a self-adapting algorithm (Part II): Improving efficiency

In this article, I will continue the development of the topic by improving the flexibility of the previously created algorithm. The algorithm became more stable with an increase in the number of candles in the analysis window or with an increase in the threshold percentage of the overweight of falling or growing candles. I had to make a compromise and set a larger sample size for analysis or a larger percentage of the prevailing candle excess.
preview
Brute force approach to pattern search (Part III): New horizons

Brute force approach to pattern search (Part III): New horizons

This article provides a continuation to the brute force topic, and it introduces new opportunities for market analysis into the program algorithm, thereby accelerating the speed of analysis and improving the quality of results. New additions enable the highest-quality view of global patterns within this approach.
Developing a self-adapting algorithm (Part I): Finding a basic pattern
Developing a self-adapting algorithm (Part I): Finding a basic pattern

Developing a self-adapting algorithm (Part I): Finding a basic pattern

In the upcoming series of articles, I will demonstrate the development of self-adapting algorithms considering most market factors, as well as show how to systematize these situations, describe them in logic and take them into account in your trading activity. I will start with a very simple algorithm that will gradually acquire theory and evolve into a very complex project.