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
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.
Principles of Exchange Pricing through the Example of Moscow Exchange's Derivatives Market
Principles of Exchange Pricing through the Example of Moscow Exchange's Derivatives Market

Principles of Exchange Pricing through the Example of Moscow Exchange's Derivatives Market

This article describes the theory of exchange pricing and clearing specifics of Moscow Exchange's Derivatives Market. This is a comprehensive article for beginners who want to get their first exchange experience on derivatives trading, as well as for experienced forex traders who are considering trading on a centralized exchange platform.
preview
Learn how to design a trading system by MFI

Learn how to design a trading system by MFI

The new article from our series about designing a trading system based on the most popular technical indicators considers a new technical indicator - the Money Flow Index (MFI). We will learn it in detail and develop a simple trading system by means of MQL5 to execute it in MetaTrader 5.
preview
Learn how to design a trading system by Fractals

Learn how to design a trading system by Fractals

This article is a new one from our series about how to design a trading system based on the most popular technical indicators. We will learn a new indicator which Fractals indicator and we will learn how to design a trading system based on it to be executed in the MetaTrader 5 terminal.
preview
Trade Events in MetaTrader 5

Trade Events in MetaTrader 5

A monitoring of the current state of a trade account implies controlling open positions and orders. Before a trade signal becomes a deal, it should be sent from the client terminal as a request to the trade server, where it will be placed in the order queue awaiting to be processed. Accepting of a request by the trade server, deleting it as it expires or conducting a deal on its basis - all those actions are followed by trade events; and the trade server informs the terminal about them.
Combinatorics and probability theory for trading (Part III): The first mathematical model
Combinatorics and probability theory for trading (Part III): The first mathematical model

Combinatorics and probability theory for trading (Part III): The first mathematical model

A logical continuation of the earlier discussed topic would be the development of multifunctional mathematical models for trading tasks. In this article, I will describe the entire process related to the development of the first mathematical model describing fractals, from scratch. This model should become an important building block and be multifunctional and universal. It will build up our theoretical basis for further development of this idea.
preview
Risk and capital management using Expert Advisors

Risk and capital management using Expert Advisors

This article is about what you can not see in a backtest report, what you should expect using automated trading software, how to manage your money if you are using expert advisors, and how to cover a significant loss to remain in the trading activity when you are using automated procedures.
Dr. Tradelove or How I Stopped Worrying and Created a Self-Training Expert Advisor
Dr. Tradelove or How I Stopped Worrying and Created a Self-Training Expert Advisor

Dr. Tradelove or How I Stopped Worrying and Created a Self-Training Expert Advisor

Just over a year ago joo, in his article "Genetic Algorithms - It's Easy!", gave us a tool for implementation of the genetic algorithm in MQL5. Now utilizing the tool we will create an Expert Advisor that will genetically optimize its own parameters upon certain boundary conditions...
preview
Take a few lessons from Prop Firms (Part 1) — An introduction

Take a few lessons from Prop Firms (Part 1) — An introduction

In this introductory article, I address a few of the lessons one can take from the challenge rules that proprietary trading firms implement. This is especially relevant for beginners and those who struggle to find their footing in this world of trading. The subsequent article will address the code implementation.
preview
Learn how to design a trading system by Awesome Oscillator

Learn how to design a trading system by Awesome Oscillator

In this new article in our series, we will learn about a new technical tool that may be useful in our trading. It is the Awesome Oscillator (AO) indicator. We will learn how to design a trading system by this indicator.
MQL5 Cookbook: Processing of the TradeTransaction Event
MQL5 Cookbook: Processing of the TradeTransaction Event

MQL5 Cookbook: Processing of the TradeTransaction Event

This article considers capabilities of the MQL5 language from the point of view of the event-driven programming. The greatest advantage of this approach is that the program can receive information about phased implementation of a trade operation. The article also contains an example of receiving and processing information about ongoing trade operation using the TradeTransaction event handler. In my opinion, such an approach can be used for copying deals from one terminal to another.
MQL5 Cookbook: ОСО Orders
MQL5 Cookbook: ОСО Orders

MQL5 Cookbook: ОСО Orders

Any trader's trading activity involves various mechanisms and interrelationships including relations among orders. This article suggests a solution of OCO orders processing. Standard library classes are extensively involved, as well as new data types are created herein.
Econometric Approach to Analysis of Charts
Econometric Approach to Analysis of Charts

Econometric Approach to Analysis of Charts

This article describes the econometric methods of analysis, the autocorrelation analysis and the analysis of conditional variance in particular. What is the benefit of the approach described here? Use of the non-linear GARCH models allows representing the analyzed series formally from the mathematical point of view and creating a forecast for a specified number of steps.
Building a Social Technology Startup, Part II: Programming an MQL5 REST Client
Building a Social Technology Startup, Part II: Programming an MQL5 REST Client

Building a Social Technology Startup, Part II: Programming an MQL5 REST Client

Let's now shape the PHP-based Twitter idea which was introduced in the first part of this article. We are assembling the different parts of the SDSS. Regarding the client side of the system architecture, we are relying on the new MQL5 WebRequest() function for sending trading signals via HTTP.
Combinatorics and probability for trading (Part IV): Bernoulli Logic
Combinatorics and probability for trading (Part IV): Bernoulli Logic

Combinatorics and probability for trading (Part IV): Bernoulli Logic

In this article, I decided to highlight the well-known Bernoulli scheme and to show how it can be used to describe trading-related data arrays. All this will then be used to create a self-adapting trading system. We will also look for a more generic algorithm, a special case of which is the Bernoulli formula, and will find an application for it.
How to Prepare MetaTrader 5 Quotes for Other Applications
How to Prepare MetaTrader 5 Quotes for Other Applications

How to Prepare MetaTrader 5 Quotes for Other Applications

The article describes the examples of creating directories, copying data, filing, working with the symbols in Market Watch or the common list, as well as the examples of handling errors, etc. All these elements can eventually be gathered in a single script for filing the data in a user-defined format.
preview
Learn how to design a trading system by Relative Vigor Index

Learn how to design a trading system by Relative Vigor Index

A new article in our series about how to design a trading system by the most popular technical indicator. In this article, we will learn how to do that by the Relative Vigor Index indicator.
preview
Improve Your Trading Charts With Interactive GUI's in MQL5 (Part III): Simple Movable Trading GUI

Improve Your Trading Charts With Interactive GUI's in MQL5 (Part III): Simple Movable Trading GUI

Join us in Part III of the "Improve Your Trading Charts With Interactive GUIs in MQL5" series as we explore the integration of interactive GUIs into movable trading dashboards in MQL5. This article builds on the foundations set in Parts I and II, guiding readers to transform static trading dashboards into dynamic, movable ones.
preview
Creating a comprehensive Owl trading strategy

Creating a comprehensive Owl trading strategy

My strategy is based on the classic trading fundamentals and the refinement of indicators that are widely used in all types of markets. This is a ready-made tool allowing you to follow the proposed new profitable trading strategy.
The Last Crusade
The Last Crusade

The Last Crusade

Take a look at your trading terminal. What means of price presentation can you see? Bars, candlesticks, lines. We are chasing time and prices whereas we only profit from prices. Shall we only give attention to prices when analyzing the market? This article proposes an algorithm and a script for point and figure charting ("naughts and crosses") Consideration is given to various price patterns whose practical use is outlined in recommendations provided.
preview
Developing a trading Expert Advisor from scratch (Part 19): New order system (II)

Developing a trading Expert Advisor from scratch (Part 19): New order system (II)

In this article, we will develop a graphical order system of the "look what happens" type. Please note that we are not starting from scratch this time, but we will modify the existing system by adding more objects and events on the chart of the asset we are trading.
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.
preview
Learn how to design a trading system by VIDYA

Learn how to design a trading system by VIDYA

Welcome to a new article from our series about learning how to design a trading system by the most popular technical indicators, in this article we will learn about a new technical tool and learn how to design a trading system by Variable Index Dynamic Average (VIDYA).
Combinatorics and probability theory for trading (Part II): Universal fractal
Combinatorics and probability theory for trading (Part II): Universal fractal

Combinatorics and probability theory for trading (Part II): Universal fractal

In this article, we will continue to study fractals and will pay special attention to summarizing all the material. To do this, I will try to bring all earlier developments into a compact form which would be convenient and understandable for practical application in trading.
preview
Understanding order placement in MQL5

Understanding order placement in MQL5

When creating any trading system, there is a task we need to deal with effectively. This task is order placement or to let the created trading system deal with orders automatically because it is crucial in any trading system. So, you will find in this article most of the topics that you need to understand about this task to create your trading system in terms of order placement effectively.
Controlling the Slope of Balance Curve During Work of an Expert Advisor
Controlling the Slope of Balance Curve During Work of an Expert Advisor

Controlling the Slope of Balance Curve During Work of an Expert Advisor

Finding rules for a trade system and programming them in an Expert Advisor is a half of the job. Somehow, you need to correct the operation of the Expert Advisor as it accumulates the results of trading. This article describes one of approaches, which allows improving performance of an Expert Advisor through creation of a feedback that measures slope of the balance curve.
Swaps (Part I): Locking and Synthetic Positions
Swaps (Part I): Locking and Synthetic Positions

Swaps (Part I): Locking and Synthetic Positions

In this article I will try to expand the classic concept of swap trading methods. I will explain why I have come to the conclusion that this concept deserves special attention and is absolutely recommended for study.
An Example of Developing a Spread Strategy for Moscow Exchange Futures
An Example of Developing a Spread Strategy for Moscow Exchange Futures

An Example of Developing a Spread Strategy for Moscow Exchange Futures

The MetaTrader 5 platform allows developing and testing trading robots that simultaneously trade multiple financial instruments. The built-in Strategy Tester automatically downloads required tick history from the broker's server taking into account contract specifications, so the developer does not need to do anything manually. This makes it possible to easily and reliably reproduce trading environment conditions, including even millisecond intervals between the arrival of ticks on different symbols. In this article we will demonstrate the development and testing of a spread strategy on two Moscow Exchange futures.
preview
Gradient Boosting (CatBoost) in the development of trading systems. A naive approach

Gradient Boosting (CatBoost) in the development of trading systems. A naive approach

Training the CatBoost classifier in Python and exporting the model to mql5, as well as parsing the model parameters and a custom strategy tester. The Python language and the MetaTrader 5 library are used for preparing the data and for training the model.
Social Trading with the MetaTrader 4 and MetaTrader 5 Trading Platforms
Social Trading with the MetaTrader 4 and MetaTrader 5 Trading Platforms

Social Trading with the MetaTrader 4 and MetaTrader 5 Trading Platforms

What is social trading? It is a mutually beneficial cooperation of traders and investors whereby successful traders allow monitoring of their trading and potential investors take the opportunity to monitor their performance and copy trades of those who look more promising.
Drawing Indicator's Emissions in MQL5
Drawing Indicator's Emissions in MQL5

Drawing Indicator's Emissions in MQL5

In this article, we will consider the emission of indicators - a new approach to the market research. The calculation of emission is based on the intersection of different indicators: more and more points with different colors and shapes appear after each tick. They form numerous clusters like nebulae, clouds, tracks, lines, arcs, etc. These shapes help to detect the invisible springs and forces that affect the movement of market prices.
MQL5 Cookbook: Handling BookEvent
MQL5 Cookbook: Handling BookEvent

MQL5 Cookbook: Handling BookEvent

This article considers BookEvent - a Depth of Market event, and the principle of its processing. An MQL program, handling states of Depth of Market, serves as an example. It is written using the object-oriented approach. Results of handling are displayed on the screen as a panel and Depth of Market levels.
preview
Combinatorics and probability for trading (Part V): Curve analysis

Combinatorics and probability for trading (Part V): Curve analysis

In this article, I decided to conduct a study related to the possibility of reducing multiple states to double-state systems. The main purpose of the article is to analyze and to come to useful conclusions that may help in the further development of scalable trading algorithms based on the probability theory. Of course, this topic involves mathematics. However, given the experience of previous articles, I see that generalized information is more useful than details.
A scientific approach to the development of trading algorithms
A scientific approach to the development of trading algorithms

A scientific approach to the development of trading algorithms

The article considers the methodology for developing trading algorithms, in which a consistent scientific approach is used to analyze possible price patterns and to build trading algorithms based on these patterns. Development ideals are demonstrated using examples.
Multicurrency monitoring of trading signals (Part 3): Introducing search algorithms
Multicurrency monitoring of trading signals (Part 3): Introducing search algorithms

Multicurrency monitoring of trading signals (Part 3): Introducing search algorithms

In the previous article, we developed the visual part of the application, as well as the basic interaction of GUI elements. This time we are going to add internal logic and the algorithm of trading signal data preparation, as well us the ability to set up signals, to search them and to visualize them in the monitor.
preview
Learn how to design a trading system by OBV

Learn how to design a trading system by OBV

This is a new article to continue our series for beginners about how to design a trading system based on some of the popular indicators. We will learn a new indicator that is On Balance Volume (OBV), and we will learn how we can use it and design a trading system based on it.
Advantages of MQL5 Signals
Advantages of MQL5 Signals

Advantages of MQL5 Signals

Trading Signals service recently introduced in MetaTrader 5 allows traders to copy trading operations of any signals provider. Users can select any signal, subscribe to it and all deals will be copied at their accounts. Signals providers can set their subscription prices and receive a fixed monthly fee from their subscribers.
preview
Learn how to design a trading system by Accelerator Oscillator

Learn how to design a trading system by Accelerator Oscillator

A new article from our series about how to create simple trading systems by the most popular technical indicators. We will learn about a new one which is the Accelerator Oscillator indicator and we will learn how to design a trading system using it.
preview
Creating an EA that works automatically (Part 11): Automation (III)

Creating an EA that works automatically (Part 11): Automation (III)

An automated system will not be successful without proper security. However, security will not be ensured without a good understanding of certain things. In this article, we will explore why achieving maximum security in automated systems is such a challenge.
preview
Learn how to design a trading system by Standard Deviation

Learn how to design a trading system by Standard Deviation

Here is a new article in our series about how to design a trading system by the most popular technical indicators in MetaTrader 5 trading platform. In this new article, we will learn how to design a trading system by Standard Deviation indicator.