Articles on the MQL5 programming and use of trading robots

icon

Expert Advisors created for the MetaTrader platform perform a variety of functions implemented by their developers. Trading robots can track financial symbols 24 hours a day, copy deals, create and send reports, analyze news and even provide specific custom graphical interface.

The articles describe programming techniques, mathematical ideas for data processing, tips on creating and ordering of trading robots.

Add a new article
latest | best
The Channel Breakout pattern
The Channel Breakout pattern

The Channel Breakout pattern

Price trends form price channels that can be observed on financial symbol charts. The breakout of the current channel is one of the strong trend reversal signals. In this article, I suggest a way to automate the process of finding such signals and see if the channel breakout pattern can be used for creating a trading strategy.
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.
Creating a custom news feed for MetaTrader 5
Creating a custom news feed for MetaTrader 5

Creating a custom news feed for MetaTrader 5

In this article we look at the possibility of creating a flexible news feed that offers more options in terms of the type of news and also its source. The article will show how a web API can be integrated with the MetaTrader 5 terminal.
The NRTR indicator and trading modules based on NRTR for the MQL5 Wizard
The NRTR indicator and trading modules based on NRTR for the MQL5 Wizard

The NRTR indicator and trading modules based on NRTR for the MQL5 Wizard

In this article we are going to analyze the NRTR indicator and create a trading system based on this indicator. We are going to develop a module of trading signals that can be used in creating strategies based on a combination of NRTR with additional trend confirmation indicators.
Creating a new trading strategy using a technology of resolving entries into indicators
Creating a new trading strategy using a technology of resolving entries into indicators

Creating a new trading strategy using a technology of resolving entries into indicators

The article suggests a technology helping everyone to create custom trading strategies by assembling an individual indicator set, as well as to develop custom market entry signals.
Resolving entries into indicators
Resolving entries into indicators

Resolving entries into indicators

Different situations happen in trader’s life. Often, the history of successful trades allows us to restore a strategy, while looking at a loss history we try to develop and improve it. In both cases, we compare trades with known indicators. This article suggests methods of batch comparison of trades with a number of indicators.
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.
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.
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.
Practical evaluation of the adaptive market following method
Practical evaluation of the adaptive market following method

Practical evaluation of the adaptive market following method

The main difference of the trading system proposed in the article is the use of mathematical tools for analyzing stock quotes. The system applies digital filtering and spectral estimation of discrete time series. The theoretical aspects of the strategy are described and a test Expert Advisor is created.
Cross-Platform Expert Advisor: The CExpertAdvisor and CExpertAdvisors Classes
Cross-Platform Expert Advisor: The CExpertAdvisor and CExpertAdvisors Classes

Cross-Platform Expert Advisor: The CExpertAdvisor and CExpertAdvisors Classes

This article deals primarily with the classes CExpertAdvisor and CExpertAdvisors, which serve as the container for all the other components described in this article-series regarding cross-platform expert advisors.
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.
Cross-Platform Expert Advisor: Custom Stops, Breakeven and Trailing
Cross-Platform Expert Advisor: Custom Stops, Breakeven and Trailing

Cross-Platform Expert Advisor: Custom Stops, Breakeven and Trailing

This article discusses how custom stop levels can be set up in a cross-platform expert advisor. It also discusses a closely-related method by which the evolution of a stop level over time can be defined.
Deep Neural Networks (Part III). Sample selection and dimensionality reduction
Deep Neural Networks (Part III). Sample selection and dimensionality reduction

Deep Neural Networks (Part III). Sample selection and dimensionality reduction

This article is a continuation of the series of articles about deep neural networks. Here we will consider selecting samples (removing noise), reducing the dimensionality of input data and dividing the data set into the train/val/test sets during data preparation for training the neural network.
Deep Neural Networks (Part II). Working out and selecting predictors
Deep Neural Networks (Part II). Working out and selecting predictors

Deep Neural Networks (Part II). Working out and selecting predictors

The second article of the series about deep neural networks will consider the transformation and choice of predictors during the process of preparing data for training a model.
Deep Neural Networks (Part I). Preparing Data
Deep Neural Networks (Part I). Preparing Data

Deep Neural Networks (Part I). Preparing Data

This series of articles continues exploring deep neural networks (DNN), which are used in many application areas including trading. Here new dimensions of this theme will be explored along with testing of new methods and ideas using practical experiments. The first article of the series is dedicated to preparing data for DNN.
Cross-Platform Expert Advisor: Stops
Cross-Platform Expert Advisor: Stops

Cross-Platform Expert Advisor: Stops

This article discusses an implementation of stop levels in an expert advisor in order to make it compatible with the two platforms MetaTrader 4 and MetaTrader 5.
Naive Bayes classifier for signals of a set of indicators
Naive Bayes classifier for signals of a set of indicators

Naive Bayes classifier for signals of a set of indicators

The article analyzes the application of the Bayes' formula for increasing the reliability of trading systems by means of using signals from multiple independent indicators. Theoretical calculations are verified with a simple universal EA, configured to work with arbitrary indicators.
Cross-Platform Expert Advisor: Time Filters
Cross-Platform Expert Advisor: Time Filters

Cross-Platform Expert Advisor: Time Filters

This article discusses the implementation of various methods of time filtering a cross-platform expert advisor. The time filter classes are responsible for checking whether or not a given time falls under a certain time configuration setting.
Cross-Platform Expert Advisor: Money Management
Cross-Platform Expert Advisor: Money Management

Cross-Platform Expert Advisor: Money Management

This article discusses the implementation of money management method for a cross-platform expert advisor. The money management classes are responsible for the calculation of the lot size to be used for the next trade to be entered by the expert advisor.
Forecasting market movements using the Bayesian classification and indicators based on Singular Spectrum Analysis
Forecasting market movements using the Bayesian classification and indicators based on Singular Spectrum Analysis

Forecasting market movements using the Bayesian classification and indicators based on Singular Spectrum Analysis

The article considers the ideology and methodology of building a recommendatory system for time-efficient trading by combining the capabilities of forecasting with the singular spectrum analysis (SSA) and important machine learning method on the basis of Bayes' Theorem.
Cross-Platform Expert Advisor: Signals
Cross-Platform Expert Advisor: Signals

Cross-Platform Expert Advisor: Signals

This article discusses the CSignal and CSignals classes which will be used in cross-platform expert advisors. It examines the differences between MQL4 and MQL5 on how particular data needed for evaluation of trade signals are accessed to ensure that the code written will be compatible with both compilers.
Cross-Platform Expert Advisor: Order Manager
Cross-Platform Expert Advisor: Order Manager

Cross-Platform Expert Advisor: Order Manager

This article discusses the creation of an order manager for a cross-platform expert advisor. The order manager is responsible for the entry and exit of orders or positions entered by the expert, as well as for keeping an independent record of such trades that is usable for both versions.
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.
MQL5 Cookbook - Pivot trading signals
MQL5 Cookbook - Pivot trading signals

MQL5 Cookbook - Pivot trading signals

The article describes the development and implementation of a class for sending signals based on pivots — reversal levels. This class is used to form a strategy applying the Standard Library. Improving the pivot strategy by adding filters is considered.
Ready-made Expert Advisors from the MQL5 Wizard work in MetaTrader 4
Ready-made Expert Advisors from the MQL5 Wizard work in MetaTrader 4

Ready-made Expert Advisors from the MQL5 Wizard work in MetaTrader 4

The article offers a simple emulator of the MetaTrader 5 trading environment for MetaTrader 4. The emulator implements migration and adjustment of trade classes of the Standard Library. As a result, Expert Advisors generated in the MetaTrader 5 Wizard can be compiled and executed in MetaTrader 4 without changes.
Auto detection of extreme points based on a specified price variation
Auto detection of extreme points based on a specified price variation

Auto detection of extreme points based on a specified price variation

Automation of trading strategies involving graphical patterns requires the ability to search for extreme points on the charts for further processing and interpretation. Existing tools do not always provide such an ability. The algorithms described in the article allow finding all extreme points on charts. The tools discussed here are equally efficient both during trends and flat movements. The obtained results are not strongly affected by a selected timeframe and are only defined by a specified scale.
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.
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.
Cross-Platform Expert Advisor: Orders
Cross-Platform Expert Advisor: Orders

Cross-Platform Expert Advisor: Orders

MetaTrader 4 and MetaTrader 5 uses different conventions in processing trade requests. This article discusses the possibility of using a class object that can be used to represent the trades processed by the server, in order for a cross-platform expert advisor to further work on them, regardless of the version of the trading platform and mode being used.
MQL5 Cookbook - Trading signals of moving channels
MQL5 Cookbook - Trading signals of moving channels

MQL5 Cookbook - Trading signals of moving channels

The article describes the process of developing and implementing a class for sending signals based on the moving channels. Each of the signal version is followed by a trading strategy with testing results. Classes of the Standard Library are used for creating derived classes.
How to copy signals using an EA by your rules?
How to copy signals using an EA by your rules?

How to copy signals using an EA by your rules?

When you subscribe to signals, such situation may occur: your trade account has a leverage of 1:100, the provider has a leverage of 1:500 and trades using the minimal lot, and your trade balances are virtually equal — but the copy ratio will comprise only 10% to 15%. This article describes how to increase the copy rate in such cases.
Cross-Platform Expert Advisor: Reuse of Components from the MQL5 Standard Library
Cross-Platform Expert Advisor: Reuse of Components from the MQL5 Standard Library

Cross-Platform Expert Advisor: Reuse of Components from the MQL5 Standard Library

There exists some components in the MQL5 Standard Library that may prove to be useful in the MQL4 version of cross-platform expert advisors. This article deals with a method of making certain components of the MQL5 Standard Library compatible with the MQL4 compiler.
Cross-Platform Expert Advisor: Introduction
Cross-Platform Expert Advisor: Introduction

Cross-Platform Expert Advisor: Introduction

This article details a method by which cross-platform expert advisors can be developed faster and easier. The proposed method consolidates the features shared by both versions into a single class, and splits the implementation on derived classes for incompatible features.
The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market

The checks a trading robot must pass before publication in the Market

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
Creating a trading robot for Moscow Exchange. Where to start?
Creating a trading robot for Moscow Exchange. Where to start?

Creating a trading robot for Moscow Exchange. Where to start?

Many traders on Moscow Exchange would like to automate their trading algorithms, but they do not know where to start. The MQL5 language offers a huge range of trading functions, and it additionally provides ready classes that help users to make their first steps in algo trading.
Creating an assistant in manual trading
Creating an assistant in manual trading

Creating an assistant in manual trading

The number of trading robots used on the currency markets has significantly increased recently. They employ various concepts and strategies, however, none of them has yet succeeded to create a win-win sample of artificial intelligence. Therefore, many traders remain committed to manual trading. But even for such specialists, robotic assistants or, so called, trading panels, are created. This article is yet another example of creating a trading panel from scratch.