New article Library for easy and quick development of MetaTrader programs (part IV): Trading events has been published:
In the previous articles, we started creating a large cross-platform library simplifying the development of programs for MetaTrader 5 and MetaTrader 4 platforms. We already have collections of historical orders and deals, market orders and positions, as well as the class for convenient selection and sorting of orders. In this part, we will continue the development of the base object and teach the Engine Library to track trading events on the account.
Let's launch the EA in the tester and try the buttons:
All is activated correctly, and the journal receives messages about occurring events.
Currently, all event messages in the tester journal are displayed in the
CEngine::WorkWithHedgeCollections() method of the library base object,
and we need the custom program to know the event codes in order to
"understand" what happened on the account. This will allow us to form
the program's respond logic depending on an event. To test the ability
to achieve that, we will create two methods in the base object of the
library. One method is to store the code of the last event, while
another one is to decode this code consisting of a set of event flags.
Author: Artyom Trishkin