MQL5 Programming Articles

icon

Study the MQL5 language for programming trading strategies in numerous published articles mostly written by you - the community members. The articles are grouped into categories to help you quicker find answers to any questions related to programming: Integration, Tester, Trading Strategies, etc.

Follow our new publications and discuss them on the Forum!

Add a new article
latest | best
preview
Data Science and Machine Learning (Part 05): Decision Trees

Data Science and Machine Learning (Part 05): Decision Trees

Decision trees imitate the way humans think to classify data. Let's see how to build trees and use them to classify and predict some data. The main goal of the decision trees algorithm is to separate the data with impurity and into pure or close to nodes.
preview
Developing a trading Expert Advisor from scratch (Part 9): A conceptual leap (II)

Developing a trading Expert Advisor from scratch (Part 9): A conceptual leap (II)

In this article, we will place Chart Trade in a floating window. In the previous part, we created a basic system which enables the use of templates within a floating window.
preview
Learn how to design a trading system by Ichimoku

Learn how to design a trading system by Ichimoku

Here is a new article in our series about how to design a trading system b the most popular indicators, we will talk about the Ichimoku indicator in detail and how to design a trading system by this indicator.
preview
DoEasy. Controls (Part 4): Panel control, Padding and Dock parameters

DoEasy. Controls (Part 4): Panel control, Padding and Dock parameters

In this article, I will implement handling Padding (internal indents/margin on all sides of an element) and Dock parameters (the way an object is located inside its container).
preview
How to master Machine Learning

How to master Machine Learning

Check out this selection of useful materials which can assist traders in improving their algorithmic trading knowledge. The era of simple algorithms is passing, and it is becoming harder to succeed without the use of Machine Learning techniques and Neural Networks.
preview
MQL5 Wizard techniques you should know (Part 01): Regression Analysis

MQL5 Wizard techniques you should know (Part 01): Regression Analysis

Todays trader is a philomath who is almost always (either consciously or not...) looking up new ideas, trying them out, choosing to modify them or discard them; an exploratory process that should cost a fair amount of diligence. This clearly places a premium on the trader's time and the need to avoid mistakes. These series of articles will proposition that the MQL5 wizard should be a mainstay for traders. Why? Because not only does the trader save time by assembling his new ideas with the MQL5 wizard, and greatly reduce mistakes from duplicate coding; he is ultimately set-up to channel his energy on the few critical areas of his trading philosophy.
preview
Developing a trading Expert Advisor from scratch (Part 8): A conceptual leap

Developing a trading Expert Advisor from scratch (Part 8): A conceptual leap

What is the easiest way to implement new functionality? In this article, we will take one step back and then two steps forward.
preview
DoEasy. Controls (Part 3): Creating bound controls

DoEasy. Controls (Part 3): Creating bound controls

In this article, I will create subordinate controls bound to the base element. The development will be performed using the base control functionality. In addition, I will tinker with the graphical element shadow object a bit since it still suffers from some logic errors when applied to any of the objects capable of having a shadow.
preview
Learn how to design a trading system by Volumes

Learn how to design a trading system by Volumes

Here is a new article from our series about learning how to design a trading system based on the most popular technical indicators. The current article will be devoted to the Volumes indicator. Volume as a concept is one of the very important factors in financial markets trading and we have to pay attention to it. Through this article, we will learn how to design a simple trading system by Volumes indicator.
preview
DoEasy. Controls (Part 2): Working on the CPanel class

DoEasy. Controls (Part 2): Working on the CPanel class

In the current article, I will get rid of some errors related to handling graphical elements and continue the development of the CPanel control. In particular, I will implement the methods for setting the parameters of the font used by default for all panel text objects.
preview
Learn how to design a trading system by MFI

Learn how to design a trading system by MFI

The new article from our series about designing a trading system based on the most popular technical indicators considers a new technical indicator - the Money Flow Index (MFI). We will learn it in detail and develop a simple trading system by means of MQL5 to execute it in MetaTrader 5.
preview
Data Science and Machine Learning (Part 04): Predicting Current Stock Market Crash

Data Science and Machine Learning (Part 04): Predicting Current Stock Market Crash

In this article I am going to attempt to use our logistic model to predict the stock market crash based upon the fundamentals of the US economy, the NETFLIX and APPLE are the stocks we are going to focus on, Using the previous market crashes of 2019 and 2020 let's see how our model will perform in the current dooms and glooms.
preview
Learn how to design a trading system by Accumulation/Distribution (AD)

Learn how to design a trading system by Accumulation/Distribution (AD)

Welcome to the new article from our series about learning how to design trading systems based on the most popular technical indicators. In this article, we will learn about a new technical indicator called Accumulation/Distribution indicator and find out how to design an MQL5 trading system based on simple AD trading strategies.
Video: How to setup MetaTrader 5 and MQL5 for simple automated trading
Video: How to setup MetaTrader 5 and MQL5 for simple automated trading

Video: How to setup MetaTrader 5 and MQL5 for simple automated trading

In this little video course you will learn how to download, install and setup MetaTrader 5 for Automated Trading. You will also learn how to adjust the chart settings and the options for automated trading. You will do your first backtest and by the end of this course you will know how to import an Expert Advisor that can automatically trade 24/7 while you don't have to sit in front of your screen.
preview
DoEasy. Controls (Part 1): First steps

DoEasy. Controls (Part 1): First steps

This article starts an extensive topic of creating controls in Windows Forms style using MQL5. My first object of interest is creating the panel class. It is already becoming difficult to manage things without controls. Therefore, I will create all possible controls in Windows Forms style.
preview
Developing a trading Expert Advisor from scratch (Part 7): Adding Volume at Price (I)

Developing a trading Expert Advisor from scratch (Part 7): Adding Volume at Price (I)

This is one of the most powerful indicators currently existing. Anyone who trades trying to have a certain degree of confidence must have this indicator on their chart. Most often the indicator is used by those who prefer “tape reading” while trading. Also, this indicator can be utilized by those who use only Price Action while trading.
preview
Learn how to design a trading system by OBV

Learn how to design a trading system by OBV

This is a new article to continue our series for beginners about how to design a trading system based on some of the popular indicators. We will learn a new indicator that is On Balance Volume (OBV), and we will learn how we can use it and design a trading system based on it.
Video: Simple automated trading – How to create a simple Expert Advisor with MQL5
Video: Simple automated trading – How to create a simple Expert Advisor with MQL5

Video: Simple automated trading – How to create a simple Expert Advisor with MQL5

The majority of students in my courses felt that MQL5 was really difficult to understand. In addition to this, they were searching for a straightforward method to automate a few processes. Find out how to begin working with MQL5 right now by reading the information contained in this article. Even if you have never done any form of programming before. And even in the event that you are unable to comprehend the previous illustrations that you have observed.
preview
Graphics in DoEasy library (Part 100): Making improvements in handling extended standard graphical objects

Graphics in DoEasy library (Part 100): Making improvements in handling extended standard graphical objects

In the current article, I will eliminate obvious flaws in simultaneous handling of extended (and standard) graphical objects and form objects on canvas, as well as fix errors detected during the test performed in the previous article. The article concludes this section of the library description.
preview
Multiple indicators on one chart (Part 06): Turning MetaTrader 5 into a RAD system (II)

Multiple indicators on one chart (Part 06): Turning MetaTrader 5 into a RAD system (II)

In my previous article, I showed you how to create a Chart Trade using MetaTrader 5 objects and thus to turn the platform into a RAD system. The system works very well, and for sure many of the readers might have thought about creating a library, which would allow having extended functionality in the proposed system. Based on this, it would be possible to develop a more intuitive Expert Advisor with a nicer and easier to use interface.
preview
Data Science and Machine Learning (Part 03): Matrix Regressions

Data Science and Machine Learning (Part 03): Matrix Regressions

This time our models are being made by matrices, which allows flexibility while it allows us to make powerful models that can handle not only five independent variables but also many variables as long as we stay within the calculations limits of a computer, this article is going to be an interesting read, that's for sure.
preview
Learn how to design a trading system by Parabolic SAR

Learn how to design a trading system by Parabolic SAR

In this article, we will continue our series about how to design a trading system using the most popular indicators. In this article, we will learn about the Parabolic SAR indicator in detail and how we can design a trading system to be used in MetaTrader 5 using some simple strategies.
preview
Multiple indicators on one chart (Part 05): Turning MetaTrader 5 into a RAD system (I)

Multiple indicators on one chart (Part 05): Turning MetaTrader 5 into a RAD system (I)

There are a lot of people who do not know how to program but they are quite creative and have great ideas. However, the lack of programming knowledge prevents them from implementing these ideas. Let's see together how to create a Chart Trade using the MetaTrader 5 platform itself, as if it were an IDE.
preview
Graphics in DoEasy library (Part 99): Moving an extended graphical object using a single control point

Graphics in DoEasy library (Part 99): Moving an extended graphical object using a single control point

In the previous article, I implemented the ability to move pivot points of an extended graphical object using control forms. Now I am going to implement the ability to move a composite graphical object using a single graphical object control point (form).
preview
Multiple indicators on one chart (Part 04): Advancing to an Expert Advisor

Multiple indicators on one chart (Part 04): Advancing to an Expert Advisor

In my previous articles, I have explained how to create an indicator with multiple subwindows, which becomes interesting when using custom indicators. This time we will see how to add multiple windows to an Expert Advisor.
preview
Graphics in DoEasy library (Part 98): Moving pivot points of extended standard graphical objects

Graphics in DoEasy library (Part 98): Moving pivot points of extended standard graphical objects

In the article, I continue the development of extended standard graphical objects and create the functionality for moving pivot points of composite graphical objects using the control points for managing the coordinates of the graphical object pivot points.
preview
Learn how to design a trading system by ATR

Learn how to design a trading system by ATR

In this article, we will learn a new technical tool that can be used in trading, as a continuation within the series in which we learn how to design simple trading systems. This time we will work with another popular technical indicator: Average True Range (ATR).
preview
Tips from a professional programmer (Part III): Logging. Connecting to the Seq log collection and analysis system

Tips from a professional programmer (Part III): Logging. Connecting to the Seq log collection and analysis system

Implementation of the Logger class for unifying and structuring messages which are printed to the Experts log. Connection to the Seq log collection and analysis system. Monitoring log messages online.
preview
Multiple indicators on one chart (Part 03): Developing definitions for users

Multiple indicators on one chart (Part 03): Developing definitions for users

Today we will update the functionality of the indicator system for the first time. In the previous article within the "Multiple indicators on one chart" we considered the basic code which allows using more than one indicator in a chart subwindow. But what was presented was just the starting base of a much larger system.
preview
Multiple indicators on one chart (Part 02): First experiments

Multiple indicators on one chart (Part 02): First experiments

In the previous article "Multiple indicators on one chart" I presented the concept and the basics of how to use multiple indicators on one chart. In this article, I will provide the source code and will explain it in detail.
Learn how to design a trading system by ADX
Learn how to design a trading system by ADX

Learn how to design a trading system by ADX

In this article, we will continue our series about designing a trading system using the most popular indicators and we will talk about the average directional index (ADX) indicator. We will learn this indicator in detail to understand it well and we will learn how we to use it through a simple strategy. By learning something deeply we can get more insights and we can use it better.
preview
What you can do with Moving Averages

What you can do with Moving Averages

The article considers several methods of applying the Moving Average indicator. Each method involving a curve analysis is accompanied by indicators visualizing the idea. In most cases, the ideas shown here belong to their respected authors. My sole task was to bring them together to let you see the main approaches and, hopefully, make more reasonable trading decisions. MQL5 proficiency level — basic.
preview
Making charts more interesting: Adding a background

Making charts more interesting: Adding a background

Many workstations contain some representative image which shows something about the user. These images make the working environment more beautiful and exciting. Let's see how to make the charts more interesting by adding a background.
preview
Graphics in DoEasy library (Part 97): Independent handling of form object movement

Graphics in DoEasy library (Part 97): Independent handling of form object movement

In this article, I will consider the implementation of the independent dragging of any form objects using a mouse. Besides, I will complement the library by error messages and new deal properties previously implemented into the terminal and MQL5.
preview
DirectX Tutorial (Part I): Drawing the first triangle

DirectX Tutorial (Part I): Drawing the first triangle

It is an introductory article on DirectX, which describes specifics of operation with the API. It should help to understand the order in which its components are initialized. The article contains an example of how to write an MQL5 script which renders a triangle using DirectX.
Learn how to design a trading system by Stochastic
Learn how to design a trading system by Stochastic

Learn how to design a trading system by Stochastic

In this article, we continue our learning series — this time we will learn how to design a trading system using one of the most popular and useful indicators, which is the Stochastic Oscillator indicator, to build a new block in our knowledge of basics.
preview
Using the CCanvas class in MQL applications

Using the CCanvas class in MQL applications

The article considers the use of the CCanvas class in MQL applications. The theory is accompanied by detailed explanations and examples for thorough understanding of CCanvas basics.
Learn how to design a trading system by MACD
Learn how to design a trading system by MACD

Learn how to design a trading system by MACD

In this article, we will learn a new tool from our series: we will learn how to design a trading system based on one of the most popular technical indicators Moving Average Convergence Divergence (MACD).
preview
Multiple indicators on one chart (Part 01): Understanding the concepts

Multiple indicators on one chart (Part 01): Understanding the concepts

Today we will learn how to add multiple indicators running simultaneously on one chart, but without occupying a separate area on it. Many traders feel more confident if they monitor multiple indicators at a time (for example, RSI, STOCASTIC, MACD, ADX and some others), or in some cases even at different assets which an index is made of.
preview
Data Science and Machine Learning (Part 02): Logistic Regression

Data Science and Machine Learning (Part 02): Logistic Regression

Data Classification is a crucial thing for an algo trader and a programmer. In this article, we are going to focus on one of classification logistic algorithms that can probability help us identify the Yes's or No's, the Ups and Downs, Buys and Sells.