
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
Check out the new article: Developing a Replay System (Part 53): Things Get Complicated (V).
In this article, we'll cover an important topic that few people understand: Custom Events. Dangers. Advantages and disadvantages of these elements. This topic is key for those who want to become a professional programmer in MQL5 or any other language. Here we will focus on MQL5 and MetaTrader 5.
Up to this point, the programs I've presented in this series have used messages, not between themselves, but within the code, so that one class can communicate with another even if they are at different levels or not related by inheritance. You can see this by looking at my class codes. Almost all of them have a common procedure: DispatchMessage. The main purpose of this procedure is to manage messages sent to the class, although there are other ways to communicate with the class, using other functions. DispatchMessage is used to manage messages addressed to a class.
This idea is not something new for me, it has been around for a long time and is aimed at creating a common interface between programs or procedures in general. Those who have been working in the field of professional programming for a long time know what we are talking about. So when you need to send data, values or queries to another program whose code you don't know at all, you use this principle. You send a message to a very specific function, and it returns specific information. They communicate precisely through this single function.
Author: Daniel Jose