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 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.
Library for easy and quick development of MetaTrader programs (part XIII): Account object events
Library for easy and quick development of MetaTrader programs (part XIII): Account object events

Library for easy and quick development of MetaTrader programs (part XIII): Account object events

The article considers working with account events for tracking important changes in account properties affecting the automated trading. We have already implemented some functionality for tracking account events in the previous article when developing the account object collection.
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.
Library for easy and quick development of MetaTrader programs (part XXI): Trading classes - Base cross-platform trading object
Library for easy and quick development of MetaTrader programs (part XXI): Trading classes - Base cross-platform trading object

Library for easy and quick development of MetaTrader programs (part XXI): Trading classes - Base cross-platform trading object

In this article, we will start the development of the new library section - trading classes. Besides, we will consider the development of a unified base trading object for MetaTrader 5 and MetaTrader 4 platforms. When sending a request to the server, such a trading object implies that verified and correct trading request parameters are passed to it.
Order Strategies. Multi-Purpose Expert Advisor
Order Strategies. Multi-Purpose Expert Advisor

Order Strategies. Multi-Purpose Expert Advisor

This article centers around strategies that actively use pending orders, a metalanguage that can be created to formally describe such strategies and the use of a multi-purpose Expert Advisor whose operation is based on those descriptions
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).
Developing Pivot Mean Oscillator: a novel Indicator for the Cumulative Moving Average
Developing Pivot Mean Oscillator: a novel Indicator for the Cumulative Moving Average

Developing Pivot Mean Oscillator: a novel Indicator for the Cumulative Moving Average

This article presents Pivot Mean Oscillator (PMO), an implementation of the cumulative moving average (CMA) as a trading indicator for the MetaTrader platforms. In particular, we first introduce Pivot Mean (PM) as a normalization index for timeseries that computes the fraction between any data point and the CMA. We then build PMO as the difference between the moving averages applied to two PM signals. Some preliminary experiments carried out on the EURUSD symbol to test the efficacy of the proposed indicator are also reported, leaving ample space for further considerations and improvements.
Forecasting Time Series (Part 2): Least-Square Support-Vector Machine (LS-SVM)
Forecasting Time Series (Part 2): Least-Square Support-Vector Machine (LS-SVM)

Forecasting Time Series (Part 2): Least-Square Support-Vector Machine (LS-SVM)

This article deals with the theory and practical application of the algorithm for forecasting time series, based on support-vector method. It also proposes its implementation in MQL and provides test indicators and Expert Advisors. This technology has not been implemented in MQL yet. But first, we have to get to know math for it.
Econometric approach to finding market patterns: Autocorrelation, Heat Maps and Scatter Plots
Econometric approach to finding market patterns: Autocorrelation, Heat Maps and Scatter Plots

Econometric approach to finding market patterns: Autocorrelation, Heat Maps and Scatter Plots

The article presents an extended study of seasonal characteristics: autocorrelation heat maps and scatter plots. The purpose of the article is to show that "market memory" is of seasonal nature, which is expressed through maximized correlation of increments of arbitrary order.
Money-Making Algorithms Employing Trailing Stop
Money-Making Algorithms Employing Trailing Stop

Money-Making Algorithms Employing Trailing Stop

This article's objective is to study profitability of algorithms with different entries into trades and exits using trailing stop. Entry types to be used are random entry and reverse entry. Stop orders to be used are trailing stop and trailing take. The article demonstrates money-making algorithms with a profitability of about 30% per annum.
Universal Expert Advisor: Trading Modes of Strategies (Part 1)
Universal Expert Advisor: Trading Modes of Strategies (Part 1)

Universal Expert Advisor: Trading Modes of Strategies (Part 1)

Any Expert Advisor developer, regardless of programming skills, is daily confronted with the same trading tasks and algorithmic problems, which should be solved to organize a reliable trading process. The article describes the possibilities of the CStrategy trading engine that can undertake the solution of these tasks and provide a user with convenient mechanism for describing a custom trading idea.
A DLL for MQL5 in 10 Minutes (Part II): Creating with Visual Studio 2017
A DLL for MQL5 in 10 Minutes (Part II): Creating with Visual Studio 2017

A DLL for MQL5 in 10 Minutes (Part II): Creating with Visual Studio 2017

The original basic article has not lost its relevance and thus if you are interested in this topic, be sure to read the first article. However much time has passed since then, so the current Visual Studio 2017 features an updated interface. The MetaTrader 5 platform has also acquired new features. The article provides a description of dll project development stages, as well as DLL setup and interaction with MetaTrader 5 tools.
Library for easy and quick development of MetaTrader programs (part XIV): Symbol object
Library for easy and quick development of MetaTrader programs (part XIV): Symbol object

Library for easy and quick development of MetaTrader programs (part XIV): Symbol object

In this article, we will create the class of a symbol object that is to be the basic object for creating the symbol collection. The class will allow us to obtain data on the necessary symbols for their further analysis and comparison.
Applying Monte Carlo method in reinforcement learning
Applying Monte Carlo method in reinforcement learning

Applying Monte Carlo method in reinforcement learning

In the article, we will apply Reinforcement learning to develop self-learning Expert Advisors. In the previous article, we considered the Random Decision Forest algorithm and wrote a simple self-learning EA based on Reinforcement learning. The main advantages of such an approach (trading algorithm development simplicity and high "training" speed) were outlined. Reinforcement learning (RL) is easily incorporated into any trading EA and speeds up its optimization.
preview
Learn how to design a trading system by Fibonacci

Learn how to design a trading system by Fibonacci

In this article, we will continue our series of creating a trading system based on the most popular technical indicator. Here is a new technical tool which is the Fibonacci and we will learn how to design a trading system based on this technical indicator.
Timeseries in DoEasy library (part 38): Timeseries collection - real-time updates and accessing data from the program
Timeseries in DoEasy library (part 38): Timeseries collection - real-time updates and accessing data from the program

Timeseries in DoEasy library (part 38): Timeseries collection - real-time updates and accessing data from the program

The article considers real-time update of timeseries data and sending messages about the "New bar" event to the control program chart from all timeseries of all symbols for the ability to handle these events in custom programs. The "New tick" class is used to determine the need to update timeseries for the non-current chart symbol and periods.
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.
How to Make Money from MetaTrader AppStore and Trading Signals Services If You Are Not a Seller or a Provider
How to Make Money from MetaTrader AppStore and Trading Signals Services If You Are Not a Seller or a Provider

How to Make Money from MetaTrader AppStore and Trading Signals Services If You Are Not a Seller or a Provider

It is possible to start making money on MQL5.com right now without having to be a seller of Market applications or a profitable signals provider. Select the products you like and post links to them on various web resources. Attract potential customers and the profit is yours!
Patterns available when trading currency baskets. Part II
Patterns available when trading currency baskets. Part II

Patterns available when trading currency baskets. Part II

We continue our discussion of the patterns traders can come across while trading currency baskets. In this part, we will consider the patterns formed when using combined trend indicators. Indicators based on a currency index are to be used as the analytical tool.
Multiple Regression Analysis. Strategy Generator and Tester in One
Multiple Regression Analysis. Strategy Generator and Tester in One

Multiple Regression Analysis. Strategy Generator and Tester in One

The article gives a description of ways of use of the multiple regression analysis for development of trading systems. It demonstrates the use of the regression analysis for strategy search automation. A regression equation generated and integrated in an EA without requiring high proficiency in programming is given as an example.
Developing a cross-platform grid EA (Last part): Diversification as a way to increase profitability
Developing a cross-platform grid EA (Last part): Diversification as a way to increase profitability

Developing a cross-platform grid EA (Last part): Diversification as a way to increase profitability

In previous articles within this series, we tried various methods for creating a more or less profitable grid Expert Advisor. Now we will try to increase the EA profitability through diversification. Our ultimate goal is to reach 100% profit per year with the maximum balance drawdown no more than 20%.
Parsing HTML with curl
Parsing HTML with curl

Parsing HTML with curl

The article provides the description of a simple HTML code parsing library using third-party components. In particular, it covers the possibilities of accessing data which cannot be retrieved using GET and POST requests. We will select a website with not too large pages and will try to obtain interesting data from this site.
preview
Practical application of neural networks in trading. Python (Part I)

Practical application of neural networks in trading. Python (Part I)

In this article, we will analyze the step-by-step implementation of a trading system based on the programming of deep neural networks in Python. This will be performed using the TensorFlow machine learning library developed by Google. We will also use the Keras library for describing neural networks.
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.
Gap - a profitable strategy or 50/50?
Gap - a profitable strategy or 50/50?

Gap - a profitable strategy or 50/50?

The article dwells on gaps — significant differences between a close price of a previous timeframe and an open price of the next one, as well as on forecasting a daily bar direction. Applying the GetOpenFileName function by the system DLL is considered as well.
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.
Library for easy and quick development of MetaTrader programs (part XVIII): Interactivity of account and any other library objects
Library for easy and quick development of MetaTrader programs (part XVIII): Interactivity of account and any other library objects

Library for easy and quick development of MetaTrader programs (part XVIII): Interactivity of account and any other library objects

The article arranges the work of an account object on a new base object of all library objects, improves the CBaseObj base object and tests setting tracked parameters, as well as receiving events for any library objects.
Universal Expert Advisor: Custom Strategies and Auxiliary Trade Classes (Part 3)
Universal Expert Advisor: Custom Strategies and Auxiliary Trade Classes (Part 3)

Universal Expert Advisor: Custom Strategies and Auxiliary Trade Classes (Part 3)

In this article, we will continue analyzing the algorithms of the CStrategy trading engine. The third part of the series contains the detailed analysis of examples of how to develop specific trading strategies using this approach. Special attention is paid to auxiliary algorithms — Expert Advisor logging system and data access using a conventional indexer (Close[1], Open[0] etc.)
Creating an Expert Advisor, which Trades on a Number of Instruments
Creating an Expert Advisor, which Trades on a Number of Instruments

Creating an Expert Advisor, which Trades on a Number of Instruments

The concept of diversification of assets on financial markets is quiet old, and has always attracted beginner traders. In this article, the author proposes a maximally simple approach to a construction of a multi-currency Expert Advisor, for an initial introduction to this direction of trading strategies.
Timeseries in DoEasy library (part 39): Library-based indicators - preparing data and timeseries events
Timeseries in DoEasy library (part 39): Library-based indicators - preparing data and timeseries events

Timeseries in DoEasy library (part 39): Library-based indicators - preparing data and timeseries events

The article deals with applying DoEasy library for creating multi-symbol multi-period indicators. We are going to prepare the library classes to work within indicators and test creating timeseries to be used as data sources in indicators. We will also implement creating and sending timeseries events.
preview
Machine learning in Grid and Martingale trading systems. Would you bet on it?

Machine learning in Grid and Martingale trading systems. Would you bet on it?

This article describes the machine learning technique applied to grid and martingale trading. Surprisingly, this approach has little to no coverage in the global network. After reading the article, you will be able to create your own trading bots.
Trading DiNapoli levels
Trading DiNapoli levels

Trading DiNapoli levels

The article considers one of the variants for Expert Advisor practical realization to trade DiNapoli levels using MQL5 standard tools. Its performance is tested and conclusions are made.
Practical application of neural networks in trading
Practical application of neural networks in trading

Practical application of neural networks in trading

In this article, we will consider the main aspects of integration of neural networks and the trading terminal, with the purpose of creating a fully featured trading robot.
MQL5.com Freelance: Developers' Source of Income (Infographic)
MQL5.com Freelance: Developers' Source of Income (Infographic)

MQL5.com Freelance: Developers' Source of Income (Infographic)

On the occasion of the MQL5 Freelance Service fourth birthday, we have prepared an info-graphic demonstrating the service results for the entire time of its existence. The figures speak for themselves: more than 10 000 orders worth about $600,000 in total have been executed to date, while 3 000 customers and 300 developers have already used the service.
preview
Mathematics in trading: Sharpe and Sortino ratios

Mathematics in trading: Sharpe and Sortino ratios

Return on investments is the most obvious indicator which investors and novice traders use for the analysis of trading efficiency. Professional traders use more reliable tools to analyze strategies, such as Sharpe and Sortino ratios, among others.
Using indicators for optimizing Expert Advisors in real time
Using indicators for optimizing Expert Advisors in real time

Using indicators for optimizing Expert Advisors in real time

Efficiency of any trading robot depends on the correct selection of its parameters (optimization). However, parameters that are considered optimal for one time interval may not retain their effectiveness in another period of trading history. Besides, EAs showing profit during tests turn out to be loss-making in real time. The issue of continuous optimization comes to the fore here. When facing plenty of routine work, humans always look for ways to automate it. In this article, I propose a non-standard approach to solving this issue.
Random Walk and the Trend Indicator
Random Walk and the Trend Indicator

Random Walk and the Trend Indicator

Random Walk looks very similar to the real market data, but it has some significant features. In this article we will consider the properties of Random Walk, simulated using the coin-tossing game. To study the properties of the data, the trendiness indicator is developed.
LifeHack for trader: "Quiet" optimization or Plotting trade distributions
LifeHack for trader: "Quiet" optimization or Plotting trade distributions

LifeHack for trader: "Quiet" optimization or Plotting trade distributions

Analysis of the trade history and plotting distribution charts of trading results in HTML depending on position entry time. The charts are displayed in three sections - by hours, by days of the week and by months.
TradeObjects: Automation of trading based on MetaTrader graphical objects
TradeObjects: Automation of trading based on MetaTrader graphical objects

TradeObjects: Automation of trading based on MetaTrader graphical objects

The article deals with a simple approach to creating an automated trading system based on the chart linear markup and offers a ready-made Expert Advisor using the standard properties of the MetaTrader 4 and 5 objects and supporting the main trading operations.
Library for easy and quick development of MetaTrader programs (part XXIII): Base trading class - verification of valid parameters
Library for easy and quick development of MetaTrader programs (part XXIII): Base trading class - verification of valid parameters

Library for easy and quick development of MetaTrader programs (part XXIII): Base trading class - verification of valid parameters

In the article, we continue the development of the trading class by implementing the control over incorrect trading order parameter values and voicing trading events.