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
A Virtual Order Manager to track orders within the position-centric MetaTrader 5 environment
A Virtual Order Manager to track orders within the position-centric MetaTrader 5 environment

A Virtual Order Manager to track orders within the position-centric MetaTrader 5 environment

This class library can be added to an MetaTrader 5 Expert Advisor to enable it to be written with an order-centric approach broadly similar to MetaTrader 4, in comparison to the position-based approach of MetaTrader 5. It does this by keeping track of virtual orders at the MetaTrader 5 client terminal, while maintaining a protective broker stop for each position for disaster protection.
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.
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.
Multicurrency monitoring of trading signals (Part 2): Implementation of the visual part of the application
Multicurrency monitoring of trading signals (Part 2): Implementation of the visual part of the application

Multicurrency monitoring of trading signals (Part 2): Implementation of the visual part of the application

In the previous article, we created the application framework, which we will use as the basis for all further work. In this part, we will proceed with the development: we will create the visual part of the application and will configure basic interaction of interface elements.
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.
Manual charting and trading toolkit (Part I). Preparation: structure description and helper class
Manual charting and trading toolkit (Part I). Preparation: structure description and helper class

Manual charting and trading toolkit (Part I). Preparation: structure description and helper class

This is the first article in a series, in which I am going to describe a toolkit which enables manual application of chart graphics by utilizing keyboard shortcuts. It is very convenient: you press one key and a trendline appears, you press another key — this will create a Fibonacci fan with the necessary parameters. It will also be possible to switch timeframes, to rearrange layers or to delete all objects from the chart.
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.
preview
Combinatorics and probability theory for trading (Part I): The basics

Combinatorics and probability theory for trading (Part I): The basics

In this series of article, we will try to find a practical application of probability theory to describe trading and pricing processes. In the first article, we will look into the basics of combinatorics and probability, and will analyze the first example of how to apply fractals in the framework of the probability theory.
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.
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.
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.
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.
Bi-Directional Trading and Hedging of Positions in MetaTrader 5 Using the HedgeTerminal Panel, Part 1
Bi-Directional Trading and Hedging of Positions in MetaTrader 5 Using the HedgeTerminal Panel, Part 1

Bi-Directional Trading and Hedging of Positions in MetaTrader 5 Using the HedgeTerminal Panel, Part 1

This article describes a new approach to hedging of positions and draws the line in the debates between users of MetaTrader 4 and MetaTrader 5 about this matter. The algorithms making such hedging reliable are described in layman's terms and illustrated with simple charts and diagrams. This article is dedicated to the new panel HedgeTerminal, which is essentially a fully featured trading terminal within MetaTrader 5. Using HedgeTerminal and the virtualization of the trade it offers, positions can be managed in the way similar to MetaTrader 4.
preview
Bid/Ask spread analysis in MetaTrader 5

Bid/Ask spread analysis in MetaTrader 5

An indicator to report your brokers Bid/Ask spread levels. Now we can use MT5s tick data to analyze what the historic true average Bid/Ask spread actually have recently been. You shouldn't need to look at the current spread because that is available if you show both bid and ask price lines.
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.
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.
Quick Manual Trading Toolkit: Basic Functionality
Quick Manual Trading Toolkit: Basic Functionality

Quick Manual Trading Toolkit: Basic Functionality

Today, many traders switch to automated trading systems which can require additional setup or can be fully automated and ready to use. However, there is a considerable part of traders who prefer trading manually, in the old fashioned way. In this article, we will create toolkit for quick manual trading, using hotkeys, and for performing typical trading actions in one click.
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.
preview
Dealing with Time (Part 1): The Basics

Dealing with Time (Part 1): The Basics

Functions and code snippets that simplify and clarify the handling of time, broker offset, and the changes to summer or winter time. Accurate timing may be a crucial element in trading. At the current hour, is the stock exchange in London or New York already open or not yet open, when does the trading time for Forex trading start and end? For a trader who trades manually and live, this is not a big problem.
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.
Better Programmer (Part 07): Notes on becoming a successful freelance developer
Better Programmer (Part 07): Notes on becoming a successful freelance developer

Better Programmer (Part 07): Notes on becoming a successful freelance developer

Do you wish to become a successful Freelance developer on MQL5? If the answer is yes, this article is right for you.
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.
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.
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.
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.
Indicator for Kagi Charting
Indicator for Kagi Charting

Indicator for Kagi Charting

The article proposes Kagi chart indicator with various charting options and additional functions. Also, indicator charting principle and its MQL5 implementation features are considered. The most popular cases of its implementation in trading are displayed - Yin/Yang exchange strategy, pushing away from the trend line and consistently increasing "shoulders"/decreasing "waists".
The Simple Example of Creating an Indicator Using Fuzzy Logic
The Simple Example of Creating an Indicator Using Fuzzy Logic

The Simple Example of Creating an Indicator Using Fuzzy Logic

The article is devoted to the practical application of the fuzzy logic concept for financial markets analysis. We propose the example of the indicator generating signals based on two fuzzy rules based on Envelopes indicator. The developed indicator uses several indicator buffers: 7 buffers for calculations, 5 buffers for the charts display and 2 color buffers.
Learn how to design a trading system by Envelopes
Learn how to design a trading system by Envelopes

Learn how to design a trading system by Envelopes

In this article, I will share with you one of the methods of how to trade bands. This time we will consider Envelopes and will see how easy it is to create some strategies based on the Envelopes.
Limitations and Verifications in Expert Advisors
Limitations and Verifications in Expert Advisors

Limitations and Verifications in Expert Advisors

Is it allowed to trade this symbol on Monday? Is there enough money to open position? How big is the loss if Stop Loss triggers? How to limit the number of pending orders? Was the trade operation executed at the current bar or at the previous one? If a trade robot cannot perform this kind of verifications, then any trade strategy can turn into a losing one. This article shows the examples of verifications that are useful in any Expert Advisor.
An Example of a Trading Strategy Based on Timezone Differences on Different Continents
An Example of a Trading Strategy Based on Timezone Differences on Different Continents

An Example of a Trading Strategy Based on Timezone Differences on Different Continents

Surfing the Internet, it is easy to find many strategies, which will give you a number of various recommendations. Let’s take an insider’s approach and look into the process of strategy creation, based on the differences in timezones on different continents.
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.
Quick Manual Trading Toolkit: Working with open positions and pending orders
Quick Manual Trading Toolkit: Working with open positions and pending orders

Quick Manual Trading Toolkit: Working with open positions and pending orders

In this article, we will expand the capabilities of the toolkit: we will add the ability to close trade positions upon specific conditions and will create tables for controlling market and pending orders, with the ability to edit these orders.
Learn how to design a trading system by CCI
Learn how to design a trading system by CCI

Learn how to design a trading system by CCI

In this new article from our series for learning how to design trading systems, I will present the Commodities Channel Index (CCI), explain its specifics, and share with you how to create a trading system based on this indicator.
Self-adapting algorithm (Part III): Abandoning optimization
Self-adapting algorithm (Part III): Abandoning optimization

Self-adapting algorithm (Part III): Abandoning optimization

It is impossible to get a truly stable algorithm if we use optimization based on historical data to select parameters. A stable algorithm should be aware of what parameters are needed when working on any trading instrument at any time. It should not forecast or guess, it should know for sure.
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.
Multicurrency monitoring of trading signals (Part 4): Enhancing functionality and improving the signal search system
Multicurrency monitoring of trading signals (Part 4): Enhancing functionality and improving the signal search system

Multicurrency monitoring of trading signals (Part 4): Enhancing functionality and improving the signal search system

In this part, we expand the trading signal searching and editing system, as well as introduce the possibility to use custom indicators and add program localization. We have previously created a basic system for searching signals, but it was based on a small set of indicators and a simple set of search rules.
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.