![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
New article MQL5 Cookbook: Handling Custom Chart Events has been published:
This article is a logical continuation of the article MQL5 Cookbook: Handling Typical Chart Events. It covers methods of work with custom chart events. Here the reader can find examples of developing and handling of custom events. All the ideas discussed in this article were implemented with object-oriented tools.
As the theme of custom events is rather broad, it is the case when a programmer and developer can introduce creativity to their work.
1. Custom Chart Event
It is clear that this event is defined by the user. It is up to a programmer to decide what exactly and which task or a program block could take the form of an event. The MQL5 developers can create their own events, which expands the language capabilities for implementation of complex algorithms.
A custom event is the second possible type of a chart event. The first one is a typical event. Although there is no such a term as "typical chart event" in the Documentation, I still suggest using it for the first ten types of chart events.
The developers suggest only one enumeration for all chart events—ENUM_CHART_EVENT.
According to the Documentation, there are 65535 identifiers of custom events. The first and the last identifiers of the custom events are set by the the explicit values of CHARTEVENT_CUSTOM and CHARTEVENT_CUSTOM_LAST, which is numerically equal to 1000 and 66534 accordingly (Fig.1).
Fig.1 The first and the last identifiers of custom events
Author: Dennis Kirichenko