Articles with examples of indicators developed in MQL5

icon

The articles contain detailed explanation of the attached codes. Download and open them in MetaEditor and program together with the author while reading the article.

Add a new article
latest | best
Graphical Interfaces X: Updates for Easy And Fast Library (Build 2)
Graphical Interfaces X: Updates for Easy And Fast Library (Build 2)

Graphical Interfaces X: Updates for Easy And Fast Library (Build 2)

Since the publication of the previous article in the series, Easy And Fast library has received some new features. The library structure and code have been partially optimized slightly reducing CPU load. Some recurring methods in many control classes have been moved to the CElement base class.
preview
Manual charting and trading toolkit (Part II). Chart graphics drawing tools

Manual charting and trading toolkit (Part II). Chart graphics drawing tools

This is the next article within the series, in which I show how I created a convenient library for manual application of chart graphics by utilizing keyboard shortcuts. The tools used include straight lines and their combinations. In this part, we will view how the drawing tools are applied using the functions described in the first part. The library can be connected to any Expert Advisor or indicator which will greatly simplify the charting tasks. This solution DOES NOT use external dlls, while all the commands are implemented using built-in MQL tools.
Graphical Interfaces X: Text Edit box, Picture Slider and simple controls (build 5)
Graphical Interfaces X: Text Edit box, Picture Slider and simple controls (build 5)

Graphical Interfaces X: Text Edit box, Picture Slider and simple controls (build 5)

This article will consider new controls: Text Edit box, Picture Slider, as well as additional simple controls: Text label and Picture. The library continues to grow, and in addition to introduction of new controls, the previously created ones are also being improved.
preview
Manual charting and trading toolkit (Part III). Optimization and new tools

Manual charting and trading toolkit (Part III). Optimization and new tools

In this article, we will further develop the idea of drawing graphical objects on charts using keyboard shortcuts. New tools have been added to the library, including a straight line plotted through arbitrary vertices, and a set of rectangles that enable the evaluation of the reversal time and level. Also, the article shows the possibility to optimize code for improved performance. The implementation example has been rewritten, allowing the use of Shortcuts alongside other trading programs. Required code knowledge level: slightly higher than a beginner.
MQL5-RPC. Remote Procedure Calls from MQL5: Web Service Access and XML-RPC ATC Analyzer for Fun and Profit
MQL5-RPC. Remote Procedure Calls from MQL5: Web Service Access and XML-RPC ATC Analyzer for Fun and Profit

MQL5-RPC. Remote Procedure Calls from MQL5: Web Service Access and XML-RPC ATC Analyzer for Fun and Profit

This article describes MQL5-RPC framework that enables Remote Procedure Calls from MQL5. It starts with XML-RPC basics, MQL5 implementation and follows with two real usage examples. First example is using external web service and the second one is a client to simple XML-RPC ATC 2011 Analyzer service. If you are interested on how to implement and analyze different statistics from ATC 2011 in real time, this article is just for you.
MQL5 Cookbook: Development of a Multi-Symbol Indicator to Analyze Price Divergence
MQL5 Cookbook: Development of a Multi-Symbol Indicator to Analyze Price Divergence

MQL5 Cookbook: Development of a Multi-Symbol Indicator to Analyze Price Divergence

In this article, we will consider the development of a multi-symbol indicator to analyze price divergence in a specified period of time. The core topics have been already discussed in the previous article on the programming of multi-currency indicators "MQL5 Cookbook: Developing a Multi-Symbol Volatility Indicator in MQL5". So this time we will dwell only on those new features and functions that have been changed dramatically. If you are new to the programming of multi-currency indicators, I recommend you to first read the previous article.
Graphical Interfaces V: The Combobox Control (Chapter 3)
Graphical Interfaces V: The Combobox Control (Chapter 3)

Graphical Interfaces V: The Combobox Control (Chapter 3)

In the first two chapters of the fifth part of the series, we developed classes for creating a scrollbar and a view list. In this chapter, we will speak about creating a class for the combobox control. This is also a compound control containing, among others, elements considered in the previous chapters of the fifth part.
Graphical Interfaces X: Text selection in the Multiline Text box (build 13)
Graphical Interfaces X: Text selection in the Multiline Text box (build 13)

Graphical Interfaces X: Text selection in the Multiline Text box (build 13)

This article will implement the ability to select text using various key combinations and deletion of the selected text, similar to the way it is done in any other text editor. In addition, we will continue to optimize the code and prepare the classes to move on to the final process of the second stage of the library's evolution, where all controls will be rendered as separate images (canvases).
Graphical Interfaces VI: the Slider and the Dual Slider Controls (Chapter 2)
Graphical Interfaces VI: the Slider and the Dual Slider Controls (Chapter 2)

Graphical Interfaces VI: the Slider and the Dual Slider Controls (Chapter 2)

In the previous article, we have enriched our library with four controls frequently used in graphical interfaces: checkbox, edit, edit with checkbox and check combobox. The second chapter of the sixth part will be dedicated to the slider and the dual slider controls.
LifeHack for Traders: Indicators of Balance, Drawdown, Load and Ticks during Testing
LifeHack for Traders: Indicators of Balance, Drawdown, Load and Ticks during Testing

LifeHack for Traders: Indicators of Balance, Drawdown, Load and Ticks during Testing

How to make the testing process more visual? The answer is simple: you need to use one or more indicators in the Strategy Tester, including a tick indicator, an indicator of balance and equity, an indicator of drawdown and deposit load. This solution will help you visually track the nature of ticks, balance and equity changes, as well as drawdown and deposit load.
MQL5 Cookbook: Developing a Multi-Symbol Volatility Indicator in MQL5
MQL5 Cookbook: Developing a Multi-Symbol Volatility Indicator in MQL5

MQL5 Cookbook: Developing a Multi-Symbol Volatility Indicator in MQL5

In this article, we will consider the development of a multi-symbol volatility indicator. The development of multi-symbol indicators may present some difficulties for novice MQL5 developers which this article helps to clarify. The major issues arising in the course of development of a multi-symbol indicator have to do with the synchronization of other symbols' data with respect to the current symbol, the lack of some indicator data and the identification of the beginning of 'true' bars of a given time frame. All of these issues will be closely considered in the article.
Graphical Interfaces II: the Menu Item Element (Chapter 1)
Graphical Interfaces II: the Menu Item Element (Chapter 1)

Graphical Interfaces II: the Menu Item Element (Chapter 1)

In the second part of the series, we will show in detail the development of such interface elements as main menu and context menu. We will also mention drawing elements and create a special class for it. We will discuss in depth such question as managing program events including custom ones.
Create your own Market Watch using the Standard Library Classes
Create your own Market Watch using the Standard Library Classes

Create your own Market Watch using the Standard Library Classes

The new MetaTrader 5 client terminal and the MQL5 Language provides new opportunities for presenting visual information to the trader. In this article, we propose a universal and extensible set of classes, which handles all the work of organizing displaying of the arbitrary text information on the chart. The example of Market Watch indicator is presented.
Graphical Interfaces VI: the Checkbox Control, the Edit Control and their Mixed Types (Chapter 1)
Graphical Interfaces VI: the Checkbox Control, the Edit Control and their Mixed Types (Chapter 1)

Graphical Interfaces VI: the Checkbox Control, the Edit Control and their Mixed Types (Chapter 1)

This article is the beginning of the sixth part of the series dedicated to the development of the library for creating graphical interfaces in the MetaTrader terminals. In the first chapter, we are going to discuss the checkbox control, the edit control and their mixed types.
preview
What you can do with Moving Averages

What you can do with Moving Averages

The article considers several methods of applying the Moving Average indicator. Each method involving a curve analysis is accompanied by indicators visualizing the idea. In most cases, the ideas shown here belong to their respected authors. My sole task was to bring them together to let you see the main approaches and, hopefully, make more reasonable trading decisions. MQL5 proficiency level — basic.
Using Layouts and Containers for GUI Controls: The CBox Class
Using Layouts and Containers for GUI Controls: The CBox Class

Using Layouts and Containers for GUI Controls: The CBox Class

This article presents an alternative method of GUI creation based on layouts and containers, using one layout manager — the CBox class. The CBox class is an auxiliary control that acts as a container for essential controls in a GUI panel. It can make designing graphical panels easier, and in some cases, reduce coding time.
Graphical interfaces X: Advanced management of lists and tables. Code optimization (build 7)
Graphical interfaces X: Advanced management of lists and tables. Code optimization (build 7)

Graphical interfaces X: Advanced management of lists and tables. Code optimization (build 7)

The library code needs to be optimized: it should be more regularized, which is — more readable and comprehensible for studying. In addition, we will continue to develop the controls created previously: lists, tables and scrollbars.
preview
An Analysis of Why Expert Advisors Fail

An Analysis of Why Expert Advisors Fail

This article presents an analysis of currency data to better understand why expert advisors can have good performance in some regions of time and poor performance in other regions of time.
Liquid Chart
Liquid Chart

Liquid Chart

Would you like to see an hourly chart with bars opening from the second and the fifth minute of the hour? What does a redrawn chart look like when the opening time of bars is changing every minute? What advantages does trading on such charts have? You will find answers to these questions in this article.
Object-Oriented Approach to Building Multi-Timeframe and Multi-Currency Panels
Object-Oriented Approach to Building Multi-Timeframe and Multi-Currency Panels

Object-Oriented Approach to Building Multi-Timeframe and Multi-Currency Panels

This article describes how object-oriented programming can be used for creating multi-timeframe and multi-currency panels for MetaTrader 5. The main goal is to build a universal panel, which can be used for displaying many different kinds of data, such as prices, price changes, indicator values or custom buy/sell conditions without the need to modify the code of the panel itself.
preview
Exploring options for creating multicolored candlesticks

Exploring options for creating multicolored candlesticks

In this article I will address the possibilities of creating customized indicators with candlesticks, pointing out their advantages and disadvantages.
Creating an Indicator with Graphical Control Options
Creating an Indicator with Graphical Control Options

Creating an Indicator with Graphical Control Options

Those who are familiar with market sentiments, know the MACD indicator (its full name is Moving Average Convergence/Divergence) - the powerful tool for analyzing the price movement, used by traders from the very first moments of appearance of the computer analysis methods. In this article we'll consider possible modifications of MACD and implement them in one indicator with the possibility to graphically switch between the modifications.
Graphical Interfaces X: Time control, List of checkboxes control and table sorting (build 6)
Graphical Interfaces X: Time control, List of checkboxes control and table sorting (build 6)

Graphical Interfaces X: Time control, List of checkboxes control and table sorting (build 6)

Development of the library for creating graphical interfaces continues. The Time and List of checkboxes controls will be covered this time. In addition, the CTable class now provides the ability to sort data in ascending or descending order.
Graphical Interfaces VII: the Tables Controls (Chapter 1)
Graphical Interfaces VII: the Tables Controls (Chapter 1)

Graphical Interfaces VII: the Tables Controls (Chapter 1)

The seventh part of the series on MetaTrader graphical interfaces deals with three table types: text label, edit box and rendered one. Another important and frequently used controls are tabs allowing you to show/hide groups of other controls and develop space effective interfaces in your MQL applications.
preview
Multiple indicators on one chart (Part 01): Understanding the concepts

Multiple indicators on one chart (Part 01): Understanding the concepts

Today we will learn how to add multiple indicators running simultaneously on one chart, but without occupying a separate area on it. Many traders feel more confident if they monitor multiple indicators at a time (for example, RSI, STOCASTIC, MACD, ADX and some others), or in some cases even at different assets which an index is made of.
Graphical Interfaces II: The Main Menu Element (Chapter 4)
Graphical Interfaces II: The Main Menu Element (Chapter 4)

Graphical Interfaces II: The Main Menu Element (Chapter 4)

This is the final chapter of the second part of the series about graphical interfaces. Here, we are going to consider the creation of the main menu. The development of this control and setting up handlers of the library classes for correct reaction to the user's actions will be demonstrated here. We will also discuss how to attach context menus to the items of the main menu. Adding to that, we will mention blocking currently inactive elements.
Drawing Channels - Inside and Outside View
Drawing Channels - Inside and Outside View

Drawing Channels - Inside and Outside View

I guess it won't be an exaggeration, if I say the channels are the most popular tool for the analysis of market and making trade decisions after the moving averages. Without diving deeply into the mass of trade strategies that use channels and their components, we are going to discuss the mathematical basis and the practical implementation of an indicator, which draws a channel determined by three extremums on the screen of the client terminal.
Graphical Interfaces V: The Vertical and Horizontal Scrollbar (Chapter 1)
Graphical Interfaces V: The Vertical and Horizontal Scrollbar (Chapter 1)

Graphical Interfaces V: The Vertical and Horizontal Scrollbar (Chapter 1)

We are still discussing the development of the library for creating graphical interfaces in the MetaTrader environment. In the first article of the fifth part of the series, we will write classes for creating vertical and horizontal scrollbars.
Graphical Interfaces IX: The Progress Bar and Line Chart Controls (Chapter 2)
Graphical Interfaces IX: The Progress Bar and Line Chart Controls (Chapter 2)

Graphical Interfaces IX: The Progress Bar and Line Chart Controls (Chapter 2)

The second chapter of the part nine is dedicated to the progress bar and line chart controls. As always, there will be detailed examples provided to reveal how these controls can be used in custom MQL applications.
Graphical Interfaces IV: Informational Interface Elements (Chapter 1)
Graphical Interfaces IV: Informational Interface Elements (Chapter 1)

Graphical Interfaces IV: Informational Interface Elements (Chapter 1)

At the current stage of development, the library for creating graphical interfaces contains a form and several controls that can be attached to it. It was mentioned before that one of the future articles would be dedicated to the multi-window mode. Now, we have everything ready for that and we will deal with it in the following chapter. In this chapter, we will write classes for creating the status bar and tooltip informational interface elements.
preview
CCI indicator. Upgrade and new features

CCI indicator. Upgrade and new features

In this article, I will consider the possibility of upgrading the CCI indicator. Besides, I will present a modification of the indicator.
preview
The RSI Deep Three Move Trading Technique

The RSI Deep Three Move Trading Technique

Presenting the RSI Deep Three Move Trading Technique in MetaTrader 5. This article is based on a new series of studies that showcase a few trading techniques based on the RSI, a technical analysis indicator used to measure the strength and momentum of a security, such as a stock, currency, or commodity.
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.
Graphical Interfaces VII: The Tabs Control (Chapter 2)
Graphical Interfaces VII: The Tabs Control (Chapter 2)

Graphical Interfaces VII: The Tabs Control (Chapter 2)

The first chapter of seventh part introduced three classes of controls for creating tables: text label table (CLabelsTable), edit box table (CTable) and rendered table (CCanvasTable). In this article (chapter two) we are going to consider the Tabs control.
Using cloud storage services for data exchange between terminals
Using cloud storage services for data exchange between terminals

Using cloud storage services for data exchange between terminals

Cloud technologies are becoming more popular. Nowadays, we can choose between paid and free storage services. Is it possible to use them in trading? This article proposes a technology for exchanging data between terminals using cloud storage services.
Drawing Dial Gauges Using the CCanvas Class
Drawing Dial Gauges Using the CCanvas Class

Drawing Dial Gauges Using the CCanvas Class

We can find dial gauges in cars and airplanes, in industrial production and everyday life. They are used in all spheres which require quick response to behavior of a controlled value. This article describes the library of dial gauges for MetaTrader 5.
Graphical Interfaces II: the Separation Line and Context Menu Elements (Chapter 2)
Graphical Interfaces II: the Separation Line and Context Menu Elements (Chapter 2)

Graphical Interfaces II: the Separation Line and Context Menu Elements (Chapter 2)

In this article we will create the separation line element. It will be possible to use it not only as an independent interface element but also as a part of many other elements. After that, we will have everything required for the development of the context menu class, which will be also considered in this article in detail. Added to that, we will introduce all necessary additions to the class, which is the base for storing pointers to all the elements of the graphical interface of the application.
Graphical Interfaces I: Testing Library in Programs of Different Types and in the MetaTrader 4 Terminal (Chapter 5)
Graphical Interfaces I: Testing Library in Programs of Different Types and in the MetaTrader 4 Terminal (Chapter 5)

Graphical Interfaces I: Testing Library in Programs of Different Types and in the MetaTrader 4 Terminal (Chapter 5)

In the previous chapter of the first part of the series about graphical interfaces, the form class was enriched by methods which allowed managing the form by pressing its controls. In this article, we will test our work in different types of MQL program such as indicators and scripts. As the library was designed to be cross-platform so it could be used in all MetaTrader platforms, we will also test it in MetaTrader 4.
MQL5 Cookbook: Indicator Subwindow Controls - Scrollbar
MQL5 Cookbook: Indicator Subwindow Controls - Scrollbar

MQL5 Cookbook: Indicator Subwindow Controls - Scrollbar

Let's continue exploring various controls and this time turn our attention to scrollbar. Just like in the previous article entitled "MQL5 Cookbook: Indicator Subwindow Controls - Buttons", all operations will be performed in the indicator subwindow. Take a moment to read the above mentioned article as it provides a detailed description of working with events in the OnChartEvent() function, while this point will only be casually touched upon in this article. For illustrative purposes, this time around we will create a vertical scrollbar for a large list of all financial instrument properties that can be obtained using MQL5 resources.
Graphical Interfaces X: Sorting, rebuilding the table and controls in the cells (build 11)
Graphical Interfaces X: Sorting, rebuilding the table and controls in the cells (build 11)

Graphical Interfaces X: Sorting, rebuilding the table and controls in the cells (build 11)

We continue to add new features to the rendered table: data sorting, managing the number of columns and rows, setting the table cell types to place controls into them.