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
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.
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.
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.
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.
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
Cluster analysis (Part I): Mastering the slope of indicator lines

Cluster analysis (Part I): Mastering the slope of indicator lines

Cluster analysis is one of the most important elements of artificial intelligence. In this article, I attempt applying the cluster analysis of the indicator slope to get threshold values for determining whether a market is flat or following a trend.
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.
preview
Timeseries in DoEasy library (part 54): Descendant classes of abstract base indicator

Timeseries in DoEasy library (part 54): Descendant classes of abstract base indicator

The article considers creation of classes of descendant objects of base abstract indicator. Such objects will provide access to features of creating indicator EAs, collecting and getting data value statistics of various indicators and prices. Also, create indicator object collection from which getting access to properties and data of each indicator created in the program will be possible.
preview
Timeseries in DoEasy library (part 53): Abstract base indicator class

Timeseries in DoEasy library (part 53): Abstract base indicator class

The article considers creation of an abstract indicator which further will be used as the base class to create objects of library’s standard and custom indicators.
preview
Timeseries in DoEasy library (part 52): Cross-platform nature of multi-period multi-symbol  single-buffer standard indicators

Timeseries in DoEasy library (part 52): Cross-platform nature of multi-period multi-symbol single-buffer standard indicators

In the article, consider creation of multi-symbol multi-period standard indicator Accumulation/Distribution. Slightly improve library classes with respect to indicators so that, the programs developed for outdated platform MetaTrader 4 based on this library could work normally when switching over to MetaTrader 5.
preview
Timeseries in DoEasy library (part 51): Composite multi-period multi-symbol standard indicators

Timeseries in DoEasy library (part 51): Composite multi-period multi-symbol standard indicators

In the article, complete development of objects of multi-period multi-symbol standard indicators. Using Ichimoku Kinko Hyo standard indicator example, analyze creation of compound custom indicators which have auxiliary drawn buffers for displaying data on the chart.
preview
Timeseries in DoEasy library (part 50): Multi-period multi-symbol standard indicators with a shift

Timeseries in DoEasy library (part 50): Multi-period multi-symbol standard indicators with a shift

In the article, let’s improve library methods for correct display of multi-symbol multi-period standard indicators, which lines are displayed on the current symbol chart with a shift set in the settings. As well, let’s put things in order in methods of work with standard indicators and remove the redundant code to the library area in the final indicator program.
preview
Timeseries in DoEasy library (part 49): Multi-period multi-symbol multi-buffer standard indicators

Timeseries in DoEasy library (part 49): Multi-period multi-symbol multi-buffer standard indicators

In the current article, I will improve the library classes to implement the ability to develop multi-symbol multi-period standard indicators requiring several indicator buffers to display their data.
Timeseries in DoEasy library (part 48): Multi-period multi-symbol indicators on one buffer in a subwindow
Timeseries in DoEasy library (part 48): Multi-period multi-symbol indicators on one buffer in a subwindow

Timeseries in DoEasy library (part 48): Multi-period multi-symbol indicators on one buffer in a subwindow

The article considers an example of creating multi-symbol multi-period standard indicators using a single indicator buffer for construction and working in the indicator subwindow. I am going to prepare the library classes for working with standard indicators working in the program main window and having more than one buffer for displaying their data.
A system of voice notifications for trade events and signals
A system of voice notifications for trade events and signals

A system of voice notifications for trade events and signals

Nowadays, voice assistants play a prominent role in human life, as we often use navigators, voice search and translators. In this article, I will try to develop a simple and user friendly system of voice notifications for various trade events, market states or signals generated by trading signals.
Timeseries in DoEasy library (part 47): Multi-period multi-symbol standard indicators
Timeseries in DoEasy library (part 47): Multi-period multi-symbol standard indicators

Timeseries in DoEasy library (part 47): Multi-period multi-symbol standard indicators

In this article, I will start developing the methods of working with standard indicators, which will ultimately allow creating multi-symbol multi-period standard indicators based on library classes. Besides, I will add the "Skipped bars" event to the timeseries classes and eliminate excessive load from the main program code by moving the library preparation functions to CEngine class.
Timeseries in DoEasy library (part 46): Multi-period multi-symbol indicator buffers
Timeseries in DoEasy library (part 46): Multi-period multi-symbol indicator buffers

Timeseries in DoEasy library (part 46): Multi-period multi-symbol indicator buffers

In this article, I am going to improve the classes of indicator buffer objects to work in the multi-symbol mode. This will pave the way for creating multi-symbol multi-period indicators in custom programs. I will add the missing functionality to the calculated buffer objects allowing us to create multi-symbol multi-period standard indicators.
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.
Timeseries in DoEasy library (part 43): Classes of indicator buffer objects
Timeseries in DoEasy library (part 43): Classes of indicator buffer objects

Timeseries in DoEasy library (part 43): Classes of indicator buffer objects

The article considers the development of indicator buffer object classes as descendants of the abstract buffer object simplifying declaration and working with indicator buffers, while creating custom indicator programs based on DoEasy library.
Timeseries in DoEasy library (part 41): Sample multi-symbol multi-period indicator
Timeseries in DoEasy library (part 41): Sample multi-symbol multi-period indicator

Timeseries in DoEasy library (part 41): Sample multi-symbol multi-period indicator

In the article, we will consider a sample multi-symbol multi-period indicator using the timeseries classes of the DoEasy library displaying the chart of a selected currency pair on a selected timeframe as candles in a subwindow. I am going to modify the library classes a bit and create a separate file for storing enumerations for program inputs and selecting a compilation language.
Timeseries in DoEasy library (part 40): Library-based indicators - updating data in real time
Timeseries in DoEasy library (part 40): Library-based indicators - updating data in real time

Timeseries in DoEasy library (part 40): Library-based indicators - updating data in real time

The article considers the development of a simple multi-period indicator based on the DoEasy library. Let's improve the timeseries classes to receive data from any timeframes to display it on the current chart period.
preview
Neural Networks Made Easy

Neural Networks Made Easy

Artificial intelligence is often associated with something fantastically complex and incomprehensible. At the same time, artificial intelligence is increasingly mentioned in everyday life. News about achievements related to the use of neural networks often appear in different media. The purpose of this article is to show that anyone can easily create a neural network and use the AI achievements in trading.
Price velocity measurement methods
Price velocity measurement methods

Price velocity measurement methods

There are multiple different approaches to market research and analysis. The main ones are technical and fundamental. In technical analysis, traders collect, process and analyze numerical data and parameters related to the market, including prices, volumes, etc. In fundamental analysis, traders analyze events and news affecting the markets directly or indirectly. The article deals with price velocity measurement methods and studies trading strategies based on that methods.
Using MATLAB 2018 computational capabilities in MetaTrader 5
Using MATLAB 2018 computational capabilities in MetaTrader 5

Using MATLAB 2018 computational capabilities in MetaTrader 5

After the upgrade of the MATLAB package in 2015, it is necessary to consider a modern way of creating DLL libraries. The article uses a sample predictive indicator to illustrate the peculiarities of linking MetaTrader 5 and MATLAB using modern 64-bit versions of the platforms, which are utilized nowadays. With the entire sequence of connecting MATLAB considered, MQL5 developers will be able to create applications with advanced computational capabilities much faster, avoiding «pitfalls».
MTF indicators as the technical analysis tool
MTF indicators as the technical analysis tool

MTF indicators as the technical analysis tool

Most of traders agree that the current market state analysis starts with the evaluation of higher chart timeframes. The analysis is performed downwards to lower timeframes until the one, at which deals are performed. This analysis method seems to be a mandatory part of professional approach for successful trading. In this article, we will discuss multi-timeframe indicators and their creation ways, as well as we will provide MQL5 code examples. In addition to the general evaluation of advantages and disadvantages, we will propose a new indicator approach using the MTF mode.
Universal RSI indicator for working in two directions simultaneously
Universal RSI indicator for working in two directions simultaneously

Universal RSI indicator for working in two directions simultaneously

When developing trading algorithms, we often encounter a problem: how to determine where a trend/flat begins and ends? In this article, we try to create a universal indicator, in which we try to combine signals for different types of strategies. We will try to simplify the process of obtaining trade signals in an expert as much as possible. An example of combining several indicators in one will be given.
How to analyze the trades of the Signal selected in the chart
How to analyze the trades of the Signal selected in the chart

How to analyze the trades of the Signal selected in the chart

The trade Signals service develops in leaps and bounds. Trusting our funds to a signal provider, we would like to minimize the risk of losing our deposit. So how to puzzle out in this forest of trade signals? How to find the one that would produce profits? This paper proposes to create a tool for visually analyzing the history of trades on trade signals in a symbol chart.
Developing the oscillator-based ZigZag indicator. Example of executing a requirements specification
Developing the oscillator-based ZigZag indicator. Example of executing a requirements specification

Developing the oscillator-based ZigZag indicator. Example of executing a requirements specification

The article demonstrates the development of the ZigZag indicator in accordance with one of the sample specifications described in the article "How to prepare Requirements Specification when ordering an indicator". The indicator is built by extreme values defined using an oscillator. There is an ability to use one of five oscillators: WPR, CCI, Chaikin, RSI or Stochastic Oscillator.
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.
Synchronizing several same-symbol charts on different timeframes
Synchronizing several same-symbol charts on different timeframes

Synchronizing several same-symbol charts on different timeframes

When making trading decisions, we often have to analyze charts on several timeframes. At the same time, these charts often contain graphical objects. Applying the same objects to all charts is inconvenient. In this article, I propose to automate cloning of objects to be displayed on charts.
How to create Requirements Specification for ordering an indicator
How to create Requirements Specification for ordering an indicator

How to create Requirements Specification for ordering an indicator

Most often the first step in the development of a trading system is the creation of a technical indicator, which can identify favorable market behavior patterns. A professionally developed indicator can be ordered from the Freelance service. From this article you will learn how to create a proper Requirements Specification, which will help you to obtain the desired indicator faster.
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.
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.
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.
A New Approach to Interpreting Classic and Hidden Divergence
A New Approach to Interpreting Classic and Hidden Divergence

A New Approach to Interpreting Classic and Hidden Divergence

The article considers the classic method for divergence construction and provides an additional divergence interpretation method. A trading strategy was developed based on this new interpretation method. This strategy is also described in the article.
Implementing a Scalping Market Depth Using the CGraphic Library
Implementing a Scalping Market Depth Using the CGraphic Library

Implementing a Scalping Market Depth Using the CGraphic Library

In this article, we will create the basic functionality of a scalping Market Depth tool. Also, we will develop a tick chart based on the CGraphic library and integrate it with the order book. Using the described Market Depth, it will be possible to create a powerful assistant tool for short-term trading.
Auto search for divergences and convergences
Auto search for divergences and convergences

Auto search for divergences and convergences

The article considers all kinds of divergence: simple, hidden, extended, triple, quadruple, convergence, as well as divergences of A, B and C classes. A universal indicator for their search and display on the chart is developed.
Graphical Interfaces XI: Integrating the Standard Graphics Library (build 16)
Graphical Interfaces XI: Integrating the Standard Graphics Library (build 16)

Graphical Interfaces XI: Integrating the Standard Graphics Library (build 16)

A new version of the graphics library for creating scientific charts (the CGraphic class) has been presented recently. This update of the developed library for creating graphical interfaces will introduce a version with a new control for creating charts. Now it is even easier to visualize data of different types.
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.
Graphical Interfaces XI: Text edit boxes and Combo boxes in table cells (build 15)
Graphical Interfaces XI: Text edit boxes and Combo boxes in table cells (build 15)

Graphical Interfaces XI: Text edit boxes and Combo boxes in table cells (build 15)

In this update of the library, the Table control (the CTable class) will be supplemented with new options. The lineup of controls in the table cells is expanded, this time adding text edit boxes and combo boxes. As an addition, this update also introduces the ability to resize the window of an MQL application during its runtime.