Articles on manual and algorithmic trading in MetaTrader 5

icon

This category features articles on all aspects of trading - from manual to fully automatic trading, from Expert Advisor ideas to trading robot creation using the MQL5 Wizard. Position management, processing of trade events and money management - these integral parts of trading are covered in theses articles.

Learn how to copy trading signals and how to provide around-the-clock operation of Expert Advisors, how to create a trading robot and how to run MetaTrader on Linux and MacOS, what social trading is and how to order a trading robot.

Add a new article
latest | best
Arranging a mailing campaign by means of Google services
Arranging a mailing campaign by means of Google services

Arranging a mailing campaign by means of Google services

A trader may want to arrange a mailing campaign to maintain business relationships with other traders, subscribers, clients or friends. Besides, there may be a necessity to send screenshotas, logs or reports. These may not be the most frequently arising tasks but having such a feature is clearly an advantage. The article deals with using several Google services simultaneously, developing an appropriate assembly on C# and integrating it with MQL tools.
Developing a cross-platform Expert Advisor to set StopLoss and TakeProfit based on risk settings
Developing a cross-platform Expert Advisor to set StopLoss and TakeProfit based on risk settings

Developing a cross-platform Expert Advisor to set StopLoss and TakeProfit based on risk settings

In this article, we will create an Expert Advisor for automated entry lot calculation based on risk values. Also the Expert Advisor will be able to automatically place Take Profit with the select ratio to Stop Loss. That is, it can calculate Take Profit based on any selected ratio, such as 3 to 1, 4 to 1 or any other selected value.
Developing a cross-platform grider EA (part II): Range-based grid in trend direction
Developing a cross-platform grider EA (part II): Range-based grid in trend direction

Developing a cross-platform grider EA (part II): Range-based grid in trend direction

In this article, we will develop a grider EA for trading in a trend direction within a range. Thus, the EA is to be suited mostly for Forex and commodity markets. According to the tests, our grider showed profit since 2018. Unfortunately, this is not true for the period of 2014-2018.
Grokking market "memory" through differentiation and entropy analysis
Grokking market "memory" through differentiation and entropy analysis

Grokking market "memory" through differentiation and entropy analysis

The scope of use of fractional differentiation is wide enough. For example, a differentiated series is usually input into machine learning algorithms. The problem is that it is necessary to display new data in accordance with the available history, which the machine learning model can recognize. In this article we will consider an original approach to time series differentiation. The article additionally contains an example of a self optimizing trading system based on a received differentiated series.
Applying OLAP in trading (part 2): Visualizing the interactive multidimensional data analysis results
Applying OLAP in trading (part 2): Visualizing the interactive multidimensional data analysis results

Applying OLAP in trading (part 2): Visualizing the interactive multidimensional data analysis results

In this article, we consider the creation of an interactive graphical interface for an MQL program, which is designed for the processing of account history and trading reports using OLAP techniques. To obtain a visual result, we will use maximizable and scalable windows, an adaptive layout of rubber controls and a new control for displaying diagrams. To provide the visualization functionality, we will implement a GUI with the selection of variables along coordinate axes, as well as with the selection of aggregate functions, diagram types and sorting options.
Applying OLAP in trading (part 1): Online analysis of multidimensional data
Applying OLAP in trading (part 1): Online analysis of multidimensional data

Applying OLAP in trading (part 1): Online analysis of multidimensional data

The article describes how to create a framework for the online analysis of multidimensional data (OLAP), as well as how to implement this in MQL and to apply such analysis in the MetaTrader environment using the example of trading account history processing.
MetaTrader 5 and Python integration: receiving and sending data
MetaTrader 5 and Python integration: receiving and sending data

MetaTrader 5 and Python integration: receiving and sending data

Comprehensive data processing requires extensive tools and is often beyond the sandbox of one single application. Specialized programming languages are used for processing and analyzing data, statistics and machine learning. One of the leading programming languages for data processing is Python. The article provides a description of how to connect MetaTrader 5 and Python using sockets, as well as how to receive quotes via the terminal API.
The power of ZigZag (part II). Examples of receiving, processing and displaying data
The power of ZigZag (part II). Examples of receiving, processing and displaying data

The power of ZigZag (part II). Examples of receiving, processing and displaying data

In the first part of the article, I have described a modified ZigZag indicator and a class for receiving data of that type of indicators. Here, I will show how to develop indicators based on these tools and write an EA for tests that features making deals according to signals formed by ZigZag indicator. As an addition, the article will introduce a new version of the EasyAndFast library for developing graphical user interfaces.
The power of ZigZag (part I). Developing the base class of the indicator
The power of ZigZag (part I). Developing the base class of the indicator

The power of ZigZag (part I). Developing the base class of the indicator

Many researchers do not pay enough attention to determining the price behavior. At the same time, complex methods are used, which very often are simply “black boxes”, such as machine learning or neural networks. The most important question arising in that case is what data to submit for training a particular model.
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.
Reversing: Formalizing the entry point and developing a manual trading algorithm
Reversing: Formalizing the entry point and developing a manual trading algorithm

Reversing: Formalizing the entry point and developing a manual trading algorithm

This is the last article within the series devoted to the Reversing trading strategy. Here we will try to solve the problem, which caused the testing results instability in previous articles. We will also develop and test our own algorithm for manual trading in any market using the reversing strategy.
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.
Using limit orders instead of Take Profit without changing the EA's original code
Using limit orders instead of Take Profit without changing the EA's original code

Using limit orders instead of Take Profit without changing the EA's original code

Using limit orders instead of conventional take profits has long been a topic of discussions on the forum. What is the advantage of this approach and how can it be implemented in your trading? In this article, I want to offer you my vision of this topic.
MQL5 Cookbook: Getting properties of an open hedge position
MQL5 Cookbook: Getting properties of an open hedge position

MQL5 Cookbook: Getting properties of an open hedge position

MetaTrader 5 is a multi-asset platform. Moreover, it supports different position management systems. Such opportunities provide significantly expanded options for the implementation and formalization of trading ideas. In this article, we discuss methods of handling and accounting of position properties in the hedging mode. The article features a derived class, as well as examples showing how to get and process the properties of a hedge position.
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".
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.
950 websites broadcast the Economic Calendar from MetaQuotes
950 websites broadcast the Economic Calendar from MetaQuotes

950 websites broadcast the Economic Calendar from MetaQuotes

The widget provides websites with a detailed release schedule of 500 indicators and indices, of the world's largest economies. Thus, traders quickly receive up-to-date information on all important events with explanations and graphs in addition to the main website content.
14,000 trading robots in the MetaTrader Market
14,000 trading robots in the MetaTrader Market

14,000 trading robots in the MetaTrader Market

The largest store of ready-made applications for algo-trading now features 13,970 products. This includes 4,800 robots, 6,500 indicators, 2,400 utilities and other solutions. Almost half of the applications (6,000) are available for rent. Also, a quarter of the total number of products (3,800) can be downloaded for free.
Trading account monitoring is an indispensable trader's tool
Trading account monitoring is an indispensable trader's tool

Trading account monitoring is an indispensable trader's tool

Trading account monitoring provides a detailed report on all completed deals. All trading statistics are collected automatically and provided to you as easy-to-understand diagrams and graphs.
Expert Advisor featuring GUI: Adding functionality (part II)
Expert Advisor featuring GUI: Adding functionality (part II)

Expert Advisor featuring GUI: Adding functionality (part II)

This is the second part of the article showing the development of a multi-symbol signal Expert Advisor for manual trading. We have already created the graphical interface. It is now time to connect it with the program's functionality.
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.
Deep Neural Networks (Part VII). Ensemble of neural networks: stacking
Deep Neural Networks (Part VII). Ensemble of neural networks: stacking

Deep Neural Networks (Part VII). Ensemble of neural networks: stacking

We continue to build ensembles. This time, the bagging ensemble created earlier will be supplemented with a trainable combiner — a deep neural network. One neural network combines the 7 best ensemble outputs after pruning. The second one takes all 500 outputs of the ensemble as input, prunes and combines them. The neural networks will be built using the keras/TensorFlow package for Python. The features of the package will be briefly considered. Testing will be performed and the classification quality of bagging and stacking ensembles will be compared.
Deep Neural Networks (Part VI). Ensemble of neural network classifiers: bagging
Deep Neural Networks (Part VI). Ensemble of neural network classifiers: bagging

Deep Neural Networks (Part VI). Ensemble of neural network classifiers: bagging

The article discusses the methods for building and training ensembles of neural networks with bagging structure. It also determines the peculiarities of hyperparameter optimization for individual neural network classifiers that make up the ensemble. The quality of the optimized neural network obtained in the previous article of the series is compared with the quality of the created ensemble of neural networks. Possibilities of further improving the quality of the ensemble's classification are considered.
Visual strategy builder. Creating trading robots without programming
Visual strategy builder. Creating trading robots without programming

Visual strategy builder. Creating trading robots without programming

This article presents a visual strategy builder. It is shown how any user can create trading robots and utilities without programming. Created Expert Advisors are fully functional and can be tested in the strategy tester, optimized in the cloud or executed live on real time charts.
Developing multi-module Expert Advisors
Developing multi-module Expert Advisors

Developing multi-module Expert Advisors

MQL programming language allows implementing the concept of modular development of trading strategies. The article shows an example of developing a multi-module Expert Advisor consisting of separately compiled file modules.
Automatic construction of support and resistance lines
Automatic construction of support and resistance lines

Automatic construction of support and resistance lines

The article deals with automatic construction of support/resistance lines using local tops and bottoms of price charts. The well-known ZigZag indicator is applied to define these extreme values.
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.
How to reduce trader's risks
How to reduce trader's risks

How to reduce trader's risks

Trading in financial markets is associated with a whole range of risks that should be taken into account in the algorithms of trading systems. Reducing such risks is the most important task to make a profit when trading.
Night trading during the Asian session: How to stay profitable
Night trading during the Asian session: How to stay profitable

Night trading during the Asian session: How to stay profitable

The article deals with the concept of night trading, as well as trading strategies and their implementation in MQL5. We perform tests and make appropriate conclusions.
Testing patterns that arise when trading currency pair baskets. Part II
Testing patterns that arise when trading currency pair baskets. Part II

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

We continue testing the patterns and trying the methods described in the articles about trading currency pair baskets. Let's consider in practice, whether it is possible to use the patterns of the combined WPR graph crossing the moving average. If the answer is yes, we should consider the appropriate usage methods.
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.
R-squared as an estimation of quality of the strategy balance curve
R-squared as an estimation of quality of the strategy balance curve

R-squared as an estimation of quality of the strategy balance curve

This article describes the construction of the custom optimization criterion R-squared. This criterion can be used to estimate the quality of a strategy's balance curve and to select the most smoothly growing and stable strategies. The work discusses the principles of its construction and statistical methods used in estimation of properties and quality of this metric.
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.
Mini Market Emulator or Manual Strategy Tester
Mini Market Emulator or Manual Strategy Tester

Mini Market Emulator or Manual Strategy Tester

Mini Market Emulator is an indicator designed for partial emulation of work in the terminal. Presumably, it can be used to test "manual" strategies of market analysis and trading.
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.
Deep Neural Networks (Part IV). Creating, training and testing a model of neural network
Deep Neural Networks (Part IV). Creating, training and testing a model of neural network

Deep Neural Networks (Part IV). Creating, training and testing a model of neural network

This article considers new capabilities of the darch package (v.0.12.0). It contains a description of training of a deep neural networks with different data types, different structure and training sequence. Training results are included.
Testing patterns that arise when trading currency pair baskets. Part I
Testing patterns that arise when trading currency pair baskets. Part I

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

We begin testing the patterns and trying the methods described in the articles about trading currency pair baskets. Let's see how oversold/overbought level breakthrough patterns are applied in practice.
Patterns available when trading currency baskets. Part III
Patterns available when trading currency baskets. Part III

Patterns available when trading currency baskets. Part III

This is the final article devoted to the patterns that occur when trading currency pair baskets. It considers combined trend-following indicators and application of standard graphical constructions.
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.
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.