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
100 best optimization passes (part 1). Developing optimization analyzer
100 best optimization passes (part 1). Developing optimization analyzer

100 best optimization passes (part 1). Developing optimization analyzer

The article dwells on the development of an application for selecting the best optimization passes using several possible options. The application is able to sort out the optimization results by a variety of factors. Optimization passes are always written to a database, therefore you can always select new robot parameters without re-optimization. Besides, you are able to see all optimization passes on a single chart, calculate parametric VaR ratios and build the graph of the normal distribution of passes and trading results of a certain ratio set. Besides, the graphs of some calculated ratios are built dynamically beginning with the optimization start (or from a selected date to another selected date).
Comparative Analysis of 10 Trend Strategies
Comparative Analysis of 10 Trend Strategies

Comparative Analysis of 10 Trend Strategies

The article provides a brief overview of ten trend following strategies, as well as their testing results and comparative analysis. Based on the obtained results, we draw a general conclusion about the appropriateness, advantages and disadvantages of trend following trading.
Neural network: Self-optimizing Expert Advisor
Neural network: Self-optimizing Expert Advisor

Neural network: Self-optimizing Expert Advisor

Is it possible to develop an Expert Advisor able to optimize position open and close conditions at regular intervals according to the code commands? What happens if we implement a neural network (multilayer perceptron) in the form of a module to analyze history and provide strategy? We can make the EA optimize a neural network monthly (weekly, daily or hourly) and continue its work afterwards. Thus, we can develop a self-optimizing EA.
The Easy Way to Evaluate a Signal: Trading Activity, Drawdown/Load and MFE/MAE Distribution Charts
The Easy Way to Evaluate a Signal: Trading Activity, Drawdown/Load and MFE/MAE Distribution Charts

The Easy Way to Evaluate a Signal: Trading Activity, Drawdown/Load and MFE/MAE Distribution Charts

Subscribers often search for an appropriate signal by analyzing the total growth on the signal provider's account, which is not a bad idea. However, it is also important to analyze potential risks of a particular trading strategy. In this article we will show a simple and efficient way to evaluate a Trading Signal based on its performance values.
Writing an Expert Advisor Using the MQL5 Object-Oriented Programming Approach
Writing an Expert Advisor Using the MQL5 Object-Oriented Programming Approach

Writing an Expert Advisor Using the MQL5 Object-Oriented Programming Approach

This article focuses on the object oriented approach to doing what we did in the article "Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners" - creating a simple Expert Advisor. Most people think this is difficult, but I want to assure you that by the time you finish reading this article, you will be able to write your own Expert Advisor which is object oriented based.
Money Management by Vince. Implementation as a module for MQL5 Wizard
Money Management by Vince. Implementation as a module for MQL5 Wizard

Money Management by Vince. Implementation as a module for MQL5 Wizard

The article is based on 'The Mathematics of Money Management' by Ralph Vince. It provides the description of empirical and parametric methods used for finding the optimal size of a trading lot. Also the article features implementation of trading modules for the MQL5 Wizard based on these methods.
preview
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.
Merrill patterns
Merrill patterns

Merrill patterns

In this article, we will have a look at Merrill patterns' model and try to evaluate their current relevance. To do this, we will develop a tool to test the patterns and apply the model to various data types such as Close, High and Low prices, as well as oscillators.
Using the Kalman Filter for price direction prediction
Using the Kalman Filter for price direction prediction

Using the Kalman Filter for price direction prediction

For successful trading, we almost always need indicators that can separate the main price movement from noise fluctuations. In this article, we consider one of the most promising digital filters, the Kalman filter. The article provides the description of how to draw and use the filter.
MQL5 Wizard: How to Create a Module of Trading Signals
MQL5 Wizard: How to Create a Module of Trading Signals

MQL5 Wizard: How to Create a Module of Trading Signals

The article discusses how to write your own class of trading signals with the implementation of signals on the crossing of the price and the moving average, and how to include it to the generator of trading strategies of the MQL5 Wizard, as well as describes the structure and format of the description of the generated class for the MQL5 Wizard.
Elder-Ray (Bulls Power and Bears Power)
Elder-Ray (Bulls Power and Bears Power)

Elder-Ray (Bulls Power and Bears Power)

The article dwells on Elder-Ray trading system based on Bulls Power, Bears Power and Moving Average indicators (EMA — exponential averaging). This system was described by Alexander Elder in his book "Trading for a Living".
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.
Library for easy and quick development of MetaTrader programs (part XXII): Trading classes - Base trading class, verification of limitations
Library for easy and quick development of MetaTrader programs (part XXII): Trading classes - Base trading class, verification of limitations

Library for easy and quick development of MetaTrader programs (part XXII): Trading classes - Base trading class, verification of limitations

In this article, we will start the development of the library base trading class and add the initial verification of permissions to conduct trading operations to its first version. Besides, we will slightly expand the features and content of the base trading class.
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.
Speed Up Calculations with the MQL5 Cloud Network
Speed Up Calculations with the MQL5 Cloud Network

Speed Up Calculations with the MQL5 Cloud Network

How many cores do you have on your home computer? How many computers can you use to optimize a trading strategy? We show here how to use the MQL5 Cloud Network to accelerate calculations by receiving the computing power across the globe with the click of a mouse. The phrase "Time is money" becomes even more topical with each passing year, and we cannot afford to wait for important computations for tens of hours or even days.
Random Decision Forest in Reinforcement learning
Random Decision Forest in Reinforcement learning

Random Decision Forest in Reinforcement learning

Random Forest (RF) with the use of bagging is one of the most powerful machine learning methods, which is slightly inferior to gradient boosting. This article attempts to develop a self-learning trading system that makes decisions based on the experience gained from interaction with the market.
Combining trend and flat strategies
Combining trend and flat strategies

Combining trend and flat strategies

There are numerous trading strategies out there. Some of them look for a trend, while others define ranges of price fluctuations to trade within them. Is it possible to combine these two approaches to increase profitability?
The Use of the MQL5 Standard Trade Class libraries in writing an Expert Advisor
The Use of the MQL5 Standard Trade Class libraries in writing an Expert Advisor

The Use of the MQL5 Standard Trade Class libraries in writing an Expert Advisor

This article explains how to use the major functionalities of the MQL5 Standard Library Trade Classes in writing Expert Advisors which implements position closing and modifying, pending order placing and deletion and verifying of Margin before placing a trade. We have also demonstrated how Trade classes can be used to obtain order and deal details.
Library for easy and quick development of MetaTrader programs (part XXX): Pending trading requests - managing request objects
Library for easy and quick development of MetaTrader programs (part XXX): Pending trading requests - managing request objects

Library for easy and quick development of MetaTrader programs (part XXX): Pending trading requests - managing request objects

In the previous article, we have created the classes of pending request objects corresponding to the general concept of library objects. This time, we are going to deal with the class allowing the management of pending request objects.
The 'Turtle Soup' trading system and its 'Turtle Soup Plus One' modification
The 'Turtle Soup' trading system and its 'Turtle Soup Plus One' modification

The 'Turtle Soup' trading system and its 'Turtle Soup Plus One' modification

The article features formalized rules of two trading strategies 'Turtle Soup' and 'Turtle Soup Plus One' from Street Smarts: High Probability Short-Term Trading Strategies by Linda Bradford Raschke and Laurence A. Connors. The strategies described in the book are quite popular. But it is important to understand that the authors have developed them based on the 15...20 year old market behavior.
Projects assist in creating profitable trading robots! Or at least, so it seems
Projects assist in creating profitable trading robots! Or at least, so it seems

Projects assist in creating profitable trading robots! Or at least, so it seems

A big program starts with a small file, which then grows in size as you keep adding more functions and objects. Most robot developers utilize include files to handle this problem. However, there is a better solution: start developing any trading application in a project. There are so many reasons to do so.
Triangular arbitrage
Triangular arbitrage

Triangular arbitrage

The article deals with the popular trading method - triangular arbitrage. Here we analyze the topic in as much detail as possible, consider the positive and negative aspects of the strategy and develop the ready-made Expert Advisor code.
Reversal patterns: Testing the Double top/bottom pattern
Reversal patterns: Testing the Double top/bottom pattern

Reversal patterns: Testing the Double top/bottom pattern

Traders often look for trend reversal points since the price has the greatest potential for movement at the very beginning of a newly formed trend. Consequently, various reversal patterns are considered in the technical analysis. The Double top/bottom is one of the most well-known and frequently used ones. The article proposes the method of the pattern programmatic detection. It also tests the pattern's profitability on history data.
Fuzzy Logic in trading strategies
Fuzzy Logic in trading strategies

Fuzzy Logic in trading strategies

The article considers an example of applying the fuzzy logic to build a simple trading system, using the Fuzzy library. Variants for improving the system by combining fuzzy logic, genetic algorithms and neural networks are proposed.
Momentum Pinball trading strategy
Momentum Pinball trading strategy

Momentum Pinball trading strategy

In this article, we continue to consider writing the code to trading systems described in a book by Linda B. Raschke and Laurence A. Connors “Street Smarts: High Probability Short-Term Trading Strategies”. This time we study Momentum Pinball system: there is described creation of two indicators, trade robot and signal block on it.
Deep Neural Networks (Part V). Bayesian optimization of DNN hyperparameters
Deep Neural Networks (Part V). Bayesian optimization of DNN hyperparameters

Deep Neural Networks (Part V). Bayesian optimization of DNN hyperparameters

The article considers the possibility to apply Bayesian optimization to hyperparameters of deep neural networks, obtained by various training variants. The classification quality of a DNN with the optimal hyperparameters in different training variants is compared. Depth of effectiveness of the DNN optimal hyperparameters has been checked in forward tests. The possible directions for improving the classification quality have been determined.
Evaluation of Trade Systems - the Effectiveness of Entering, Exiting and Trades in General
Evaluation of Trade Systems - the Effectiveness of Entering, Exiting and Trades in General

Evaluation of Trade Systems - the Effectiveness of Entering, Exiting and Trades in General

There are a lot of measures that allow determining the effectiveness and profitability of a trade system. However, traders are always ready to put any system to a new crash test. The article tells how the statistics based on measures of effectiveness can be used for the MetaTrader 5 platform. It includes the class for transformation of the interpretation of statistics by deals to the one that doesn't contradict the description given in the "Statistika dlya traderov" ("Statistics for Traders") book by S.V. Bulashev. It also includes an example of custom function for optimization.
Expert Advisor based on the "New Trading Dimensions" by Bill Williams
Expert Advisor based on the "New Trading Dimensions" by Bill Williams

Expert Advisor based on the "New Trading Dimensions" by Bill Williams

In this article I will discuss the development of Expert Advisor, based on the book "New Trading Dimensions: How to Profit from Chaos in Stocks, Bonds, and Commodities" by Bill Williams. The strategy itself is well known and its use is still controversial among traders. The article considers trading signals of the system, the specifics of its implementation, and the results of testing on historical data.
Reversal patterns: Testing the Head and Shoulders pattern
Reversal patterns: Testing the Head and Shoulders pattern

Reversal patterns: Testing the Head and Shoulders pattern

This article is a follow-up to the previous one called "Reversal patterns: Testing the Double top/bottom pattern". Now we will have a look at another well-known reversal pattern called Head and Shoulders, compare the trading efficiency of the two patterns and make an attempt to combine them into a single trading system.
Visualize a Strategy in the MetaTrader 5 Tester
Visualize a Strategy in the MetaTrader 5 Tester

Visualize a Strategy in the MetaTrader 5 Tester

We all know the saying "Better to see once than hear a hundred times". You can read various books about Paris or Venice, but based on the mental images you wouldn't have the same feelings as on the evening walk in these fabulous cities. The advantage of visualization can easily be projected on any aspect of our lives, including work in the market, for example, the analysis of price on charts using indicators, and of course, the visualization of strategy testing. This article contains descriptions of all the visualization features of the MetaTrader 5 Strategy Tester.
Trading with Donchian Channels
Trading with Donchian Channels

Trading with Donchian Channels

In this article, we develop and tests several strategies based on the Donchian channel using various indicator filters. We also perform a comparative analysis of their operation.
Forecasting Time Series (Part 1): Empirical Mode Decomposition (EMD) Method
Forecasting Time Series (Part 1): Empirical Mode Decomposition (EMD) Method

Forecasting Time Series (Part 1): Empirical Mode Decomposition (EMD) Method

This article deals with the theory and practical use of the algorithm for forecasting time series, based on the empirical decomposition mode. It proposes the MQL implementation of this method and presents test indicators and Expert Advisors.
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.
How to Copy Trading from MetaTrader 5 to MetaTrader 4
How to Copy Trading from MetaTrader 5 to MetaTrader 4

How to Copy Trading from MetaTrader 5 to MetaTrader 4

Is it possible to trade on a real MetaTrader 5 account today? How to organize such trading? The article contains the theory of these questions and the working codes used for copying trades from the MetaTrader 5 terminal to MetaTrader 4. The article will be useful both for the developers of Expert Advisors and for practicing traders.
Library for easy and quick development of MetaTrader programs (part XXVIII): Closure, removal and modification of pending trading requests
Library for easy and quick development of MetaTrader programs (part XXVIII): Closure, removal and modification of pending trading requests

Library for easy and quick development of MetaTrader programs (part XXVIII): Closure, removal and modification of pending trading requests

This is the third article about the concept of pending requests. We are going to complete the tests of pending trading requests by creating the methods for closing positions, removing pending orders and modifying position and pending order parameters.
Reversing: The holy grail or a dangerous delusion?
Reversing: The holy grail or a dangerous delusion?

Reversing: The holy grail or a dangerous delusion?

In this article, we will study the reverse martingale technique and will try to understand whether it is worth using, as well as whether it can help improve your trading strategy. We will create an Expert Advisor to operate on historic data and to check what indicators are best suitable for the reversing technique. We will also check whether it can be used without any indicator as an independent trading system. In addition, we will check if reversing can turn a loss-making trading system into a profitable one.
Creating Custom Criteria of Optimization of Expert Advisors
Creating Custom Criteria of Optimization of Expert Advisors

Creating Custom Criteria of Optimization of Expert Advisors

The MetaTrader 5 Client Terminal offers a wide range of opportunities for optimization of Expert Advisor parameters. In addition to the optimization criteria included in the strategy tester, developers are given the opportunity of creating their own criteria. This leads to an almost limitless number of possibilities of testing and optimizing of Expert Advisors. The article describes practical ways of creating such criteria - both complex and simple ones.
MQL5 Wizard for Dummies
MQL5 Wizard for Dummies

MQL5 Wizard for Dummies

In early 2011 we released the first version of the MQL5 Wizard. This new application provides a simple and convenient tool to automatically generate trading robots. Any MetaTrader 5 user can create a custom Expert Advisor without even knowing how to program in MQL5.
Library for easy and quick development of MetaTrader programs (part XXXIV): Pending trading requests - removing and modifying orders and positions under certain conditions
Library for easy and quick development of MetaTrader programs (part XXXIV): Pending trading requests - removing and modifying orders and positions under certain conditions

Library for easy and quick development of MetaTrader programs (part XXXIV): Pending trading requests - removing and modifying orders and positions under certain conditions

In this article, we will complete the description of the pending request trading concept and create the functionality for removing pending orders, as well as modifying orders and positions under certain conditions. Thus, we are going to have the entire functionality enabling us to develop simple custom strategies, or rather EA behavior logic activated upon user-defined conditions.
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.