Articles on trading system automation in MQL5

icon

Read articles on the trading systems with a wide variety of ideas at the core. Learn how to use statistical methods and patterns on candlestick charts, how to filter signals and where to use semaphore indicators.

The MQL5 Wizard will help you create robots without programming to quickly check your trading ideas. Use the Wizard to learn about genetic algorithms.

Add a new article
latest | best
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.
Basic math behind Forex trading
Basic math behind Forex trading

Basic math behind Forex trading

The article aims to describe the main features of Forex trading as simply and quickly as possible, as well as share some basic ideas with beginners. It also attempts to answer the most tantalizing questions in the trading community along with showcasing the development of a simple indicator.
Testing patterns that arise when trading currency pair baskets. Part III
Testing patterns that arise when trading currency pair baskets. Part III

Testing patterns that arise when trading currency pair baskets. Part III

In this article, we finish testing the patterns that can be detected when trading currency pair baskets. Here we present the results of testing the patterns tracking the movement of pair's currencies relative to each other.
DiNapoli trading system
DiNapoli trading system

DiNapoli trading system

The article describes the Fibo levels-based trading system developed by Joe DiNapoli. The idea behind the system and the main concepts are explained, as well as a simple indicator is provided as an example for more clarity.
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.
Grid and martingale: what are they and how to use them?
Grid and martingale: what are they and how to use them?

Grid and martingale: what are they and how to use them?

In this article, I will try to explain in detail what grid and martingale are, as well as what they have in common. Besides, I will try to analyze how viable these strategies really are. The article features mathematical and practical sections.
Indicator for Constructing a Three Line Break Chart
Indicator for Constructing a Three Line Break Chart

Indicator for Constructing a Three Line Break Chart

This article is dedicated to the Three Line Break chart, suggested by Steve Nison in his book "Beyond Candlesticks". The greatest advantage of this chart is that it allows filtering minor fluctuations of a price in relation to the previous movement. We are going to discuss the principle of the chart construction, the code of the indicator and some examples of trading strategies based on it.
Genetic Algorithms - It's Easy!
Genetic Algorithms - It's Easy!

Genetic Algorithms - It's Easy!

In this article the author talks about evolutionary calculations with the use of a personally developed genetic algorithm. He demonstrates the functioning of the algorithm, using examples, and provides practical recommendations for its usage.
Exploring Seasonal Patterns of Financial Time Series with Boxplot
Exploring Seasonal Patterns of Financial Time Series with Boxplot

Exploring Seasonal Patterns of Financial Time Series with Boxplot

In this article we will view seasonal characteristics of financial time series using Boxplot diagrams. Each separate boxplot (or box-and-whiskey diagram) provides a good visualization of how values are distributed along the dataset. Boxplots should not be confused with the candlestick charts, although they can be visually similar.
Machine Learning: How Support Vector Machines can be used in Trading
Machine Learning: How Support Vector Machines can be used in Trading

Machine Learning: How Support Vector Machines can be used in Trading

Support Vector Machines have long been used in fields such as bioinformatics and applied mathematics to assess complex data sets and extract useful patterns that can be used to classify data. This article looks at what a support vector machine is, how they work and why they can be so useful in extracting complex patterns. We then investigate how they can be applied to the market and potentially used to advise on trades. Using the Support Vector Machine Learning Tool, the article provides worked examples that allow readers to experiment with their own trading.
Plotting trend lines based on fractals using MQL4 and MQL5
Plotting trend lines based on fractals using MQL4 and MQL5

Plotting trend lines based on fractals using MQL4 and MQL5

The article describes the automation of trend lines plotting based on the Fractals indicator using MQL4 and MQL5. The article structure provides a comparative view of the solution for two languages. Trend lines are plotted using two last known fractals.
Strategy builder based on Merrill patterns
Strategy builder based on Merrill patterns

Strategy builder based on Merrill patterns

In the previous article, we considered application of Merrill patterns to various data, such as to a price value on a currency symbol chart and values of standard MetaTrader 5 indicators: ATR, WPR, CCI, RSI, among others. Now, let us try to create a strategy construction set based on Merrill patterns.
Timeseries in DoEasy library (part 42): Abstract indicator buffer object class
Timeseries in DoEasy library (part 42): Abstract indicator buffer object class

Timeseries in DoEasy library (part 42): Abstract indicator buffer object class

In this article, we start the development of the indicator buffer classes for the DoEasy library. We will create the base class of the abstract buffer which is to be used as a foundation for the development of different class types of indicator buffers.
Comparative analysis of 10 flat trading strategies
Comparative analysis of 10 flat trading strategies

Comparative analysis of 10 flat trading strategies

The article explores the advantages and disadvantages of trading in flat periods. The ten strategies created and tested within this article are based on the tracking of price movements inside a channel. Each strategy is provided with a filtering mechanism, which is aimed at avoiding false market entry signals.
Trading Signal Generator Based on a Custom Indicator
Trading Signal Generator Based on a Custom Indicator

Trading Signal Generator Based on a Custom Indicator

How to create a trading signal generator based on a custom indicator? How to create a custom indicator? How to get access to custom indicator data? Why do we need the IS_PATTERN_USAGE(0) structure and model 0?
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
Create Your Own Expert Advisor in MQL5 Wizard
Create Your Own Expert Advisor in MQL5 Wizard

Create Your Own Expert Advisor in MQL5 Wizard

The knowledge of programming languages is no longer a prerequisite for creating trading robots. Earlier lack of programming skills was an impassable obstacle to the implementation of one's own trading strategies, but with the emergence of the MQL5 Wizard, the situation radically changed. Novice traders can stop worrying because of the lack of programming experience - with the new Wizard, which allows you to generate Expert Advisor code, it is not necessary.
Developing a cross-platform grid EA: testing a multi-currency EA
Developing a cross-platform grid EA: testing a multi-currency EA

Developing a cross-platform grid EA: testing a multi-currency EA

Markets dropped down by more that 30% within one month. It seems to be the best time for testing grid- and martingale-based Expert Advisors. This article is an unplanned continuation of the series "Creating a Cross-Platform Grid EA". The current market provides an opportunity to arrange a stress rest for the grid EA. So, let's use this opportunity and test our Expert Advisor.
Library for easy and quick development of MetaTrader programs (part XV): Collection of symbol objects
Library for easy and quick development of MetaTrader programs (part XV): Collection of symbol objects

Library for easy and quick development of MetaTrader programs (part XV): Collection of symbol objects

In this article, we will consider creation of a symbol collection based on the abstract symbol object developed in the previous article. The abstract symbol descendants are to clarify a symbol data and define the availability of the basic symbol object properties in a program. Such symbol objects are to be distinguished by their affiliation with groups.
Library for easy and quick development of MetaTrader programs (part XX): Creating and storing program resources
Library for easy and quick development of MetaTrader programs (part XX): Creating and storing program resources

Library for easy and quick development of MetaTrader programs (part XX): Creating and storing program resources

The article deals with storing data in the program's source code and creating audio and graphical files out of them. When developing an application, we often need audio and images. The MQL language features several methods of using such data.
Library for easy and quick development of MetaTrader programs (part I). Concept, data management and first results
Library for easy and quick development of MetaTrader programs (part I). Concept, data management and first results

Library for easy and quick development of MetaTrader programs (part I). Concept, data management and first results

While analyzing a huge number of trading strategies, orders for development of applications for MetaTrader 5 and MetaTrader 4 terminals and various MetaTrader websites, I came to the conclusion that all this diversity is based mostly on the same elementary functions, actions and values appearing regularly in different programs. This resulted in DoEasy cross-platform library for easy and quick development of МetaТrader 5 and МetaТrader 4 applications.
Library for easy and quick development of MetaTrader programs (part XXXII): Pending trading requests - placing orders under certain conditions
Library for easy and quick development of MetaTrader programs (part XXXII): Pending trading requests - placing orders under certain conditions

Library for easy and quick development of MetaTrader programs (part XXXII): Pending trading requests - placing orders under certain conditions

We continue the development of the functionality allowing users to trade using pending requests. In this article, we are going to implement the ability to place pending orders under certain conditions.
Deep Neural Networks (Part VIII). Increasing the classification quality of bagging ensembles
Deep Neural Networks (Part VIII). Increasing the classification quality of bagging ensembles

Deep Neural Networks (Part VIII). Increasing the classification quality of bagging ensembles

The article considers three methods which can be used to increase the classification quality of bagging ensembles, and their efficiency is estimated. The effects of optimization of the ELM neural network hyperparameters and postprocessing parameters are evaluated.
Library for easy and quick development of MetaTrader programs (part XXIX): Pending trading requests - request object classes
Library for easy and quick development of MetaTrader programs (part XXIX): Pending trading requests - request object classes

Library for easy and quick development of MetaTrader programs (part XXIX): Pending trading requests - request object classes

In the previous articles, we checked the concept of pending trading requests. A pending request is, in fact, a common trading order executed by a certain condition. In this article, we are going to create full-fledged classes of pending request objects — a base request object and its descendants.
Thomas DeMark's Sequential (TD SEQUENTIAL) using artificial intelligence
Thomas DeMark's Sequential (TD SEQUENTIAL) using artificial intelligence

Thomas DeMark's Sequential (TD SEQUENTIAL) using artificial intelligence

In this article, I will tell you how to successfully trade by merging a very well-known strategy and a neural network. It will be about the Thomas DeMark's Sequential strategy with the use of an artificial intelligence system. Only the first part of the strategy will be applied, using the Setup and Intersection signals.
Simple Trading Systems Using Semaphore Indicators
Simple Trading Systems Using Semaphore Indicators

Simple Trading Systems Using Semaphore Indicators

If we thoroughly examine any complex trading system, we will see that it is based on a set of simple trading signals. Therefore, there is no need for novice developers to start writing complex algorithms immediately. This article provides an example of a trading system that uses semaphore indicators to perform deals.
Library for easy and quick development of MetaTrader programs (part XXVI): Working with pending trading requests - first implementation (opening positions)
Library for easy and quick development of MetaTrader programs (part XXVI): Working with pending trading requests - first implementation (opening positions)

Library for easy and quick development of MetaTrader programs (part XXVI): Working with pending trading requests - first implementation (opening positions)

In this article, we are going to store some data in the value of the orders and positions magic number and start the implementation of pending requests. To check the concept, let's create the first test pending request for opening market positions when receiving a server error requiring waiting and sending a repeated request.
How to quickly develop and debug a trading strategy in MetaTrader 5
How to quickly develop and debug a trading strategy in MetaTrader 5

How to quickly develop and debug a trading strategy in MetaTrader 5

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.
Indicator for Point and Figure Charting
Indicator for Point and Figure Charting

Indicator for Point and Figure Charting

There are lots of chart types that provide information on the current market situation. Many of them, such as Point and Figure chart, are the legacy of the remote past. The article describes an example of Point and Figure charting using a real time indicator.
Library for easy and quick development of MetaTrader programs (part V): Classes and collection of trading events, sending events to the program
Library for easy and quick development of MetaTrader programs (part V): Classes and collection of trading events, sending events to the program

Library for easy and quick development of MetaTrader programs (part V): Classes and collection of trading events, sending events to the program

In the previous articles, we started creating a large cross-platform library simplifying the development of programs for MetaTrader 5 and MetaTrader 4 platforms. In the fourth part, we tested tracking trading events on the account. In this article, we will develop trading event classes and place them to the event collections. From there, they will be sent to the base object of the Engine library and the control program chart.
The Indicators of the Micro, Middle and Main Trends
The Indicators of the Micro, Middle and Main Trends

The Indicators of the Micro, Middle and Main Trends

The aim of this article is to investigate the possibilities of trade automation and the analysis, on the basis of some ideas from a book by James Hyerczyk "Pattern, Price & Time: Using Gann Theory in Trading Systems" in the form of indicators and Expert Advisor. Without claiming to be exhaustive, here we investigate only the Model - the first part of the Gann theory.
Creating MQL5 Expert Advisors in minutes using EA Tree: Part One
Creating MQL5 Expert Advisors in minutes using EA Tree: Part One

Creating MQL5 Expert Advisors in minutes using EA Tree: Part One

EA Tree is the first drag and drop MetaTrader MQL5 Expert Advisor builder. You can create complex MQL5 using a very easy to use graphical user interface. In EA Tree, Expert Advisors are created by connecting boxes together. Boxes may contain MQL5 functions, technical indicators, custom indicators, or values. Using the "tree of boxes", EA Tree generates the MQL5 code of the Expert Advisor.
Testing currency pair patterns: Practical application and real trading perspectives. Part IV
Testing currency pair patterns: Practical application and real trading perspectives. Part IV

Testing currency pair patterns: Practical application and real trading perspectives. Part IV

This article concludes the series devoted to trading currency pair baskets. Here we test the remaining pattern and discuss applying the entire method in real trading. Market entries and exits, searching for patterns and analyzing them, complex use of combined indicators are considered.
Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies
Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies

Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies

In this article we are going to show how to explore the Standard Library of Trading Strategy Classes and how to add Custom Strategies and Filters/Signals using the Patterns-and-Models logic of the MQL5 Wizard. In the end you will be able easily add your own strategies using MetaTrader 5 standard indicators, and MQL5 Wizard will create a clean and powerful code and fully functional Expert Advisor.
Building an Automatic News Trader
Building an Automatic News Trader

Building an Automatic News Trader

This is the continuation of Another MQL5 OOP class article which showed you how to build a simple OO EA from scratch and gave you some tips on object-oriented programming. Today I am showing you the technical basics needed to develop an EA able to trade the news. My goal is to keep on giving you ideas about OOP and also cover a new topic in this series of articles, working with the file system.
Martingale as the basis for a long-term trading strategy
Martingale as the basis for a long-term trading strategy

Martingale as the basis for a long-term trading strategy

In this article we will consider in detail the martingale system. We will review whether this system can be applied in trading and how to use it in order to minimize risks. The main disadvantage of this simple system is the probability of losing the entire deposit. This fact must be taken into account, if you decide to trade using the martingale technique.
Trading signals module using the system by Bill Williams
Trading signals module using the system by Bill Williams

Trading signals module using the system by Bill Williams

The article describes the rules of the trading system by Bill Williams, the procedure of application for a developed MQL5 module to search and mark patterns of this system on the chart, automated trading with found patterns, and also presents the results of testing on various trading instruments.
Library for easy and quick development of MetaTrader programs (part XXXI): Pending trading requests - opening positions under certain conditions
Library for easy and quick development of MetaTrader programs (part XXXI): Pending trading requests - opening positions under certain conditions

Library for easy and quick development of MetaTrader programs (part XXXI): Pending trading requests - opening positions under certain conditions

Starting with this article, we are going to develop a functionality allowing users to trade using pending requests under certain conditions, for example, when reaching a certain time limit, exceeding a specified profit or closing a position by stop loss.
Developing a cross-platform grider EA
Developing a cross-platform grider EA

Developing a cross-platform grider EA

In this article, we will learn how to create Expert Advisors (EAs) working both in MetaTrader 4 and MetaTrader 5. To do this, we are going to develop an EA constructing order grids. Griders are EAs that place several limit orders above the current price and the same number of limit orders below it simultaneously.
Patterns available when trading currency baskets
Patterns available when trading currency baskets

Patterns available when trading currency baskets

Following up our previous article on the currency baskets trading principles, here we are going to analyze the patterns traders can detect. We will also consider the advantages and the drawbacks of each pattern and provide some recommendations on their use. The indicators based on Williams' oscillator will be used as analysis tools.