New article MQL5 Cookbook: Handling BookEvent has been published:
This article considers BookEvent - a Depth of Market event, and the principle of its processing. An MQL program, handling states of Depth of Market, serves as an example. It is written using the object-oriented approach. Results of handling are displayed on the screen as a panel and Depth of Market levels.
As is well known, the MetaTrader 5
trading terminal is a multi-market platform, that facilitates trading
on Forex, stock markets, Futures and Contracts for Difference. According
to the Freelance section stats, the number of traders trading not only on Forex market is growing.
In this article I would like to introduce novice MQL5 programmers to the BookEvent
handling. This event is connected with Depth of Market—an instrument
for trading stock assets and their derivatives. Forex traders, however,
may find Depth of Market useful too. In ECN accounts, liquidity
providers supply data on the orders, though only within their aggregator
model. These accounts are becoming more popular.
According to the Documentation, this event is generated when Depth of Market status changes. Let us agree that BookEvent is a Depth of Market event.
of Market is an array of orders, which differ in direction (sell and
buy), price and volume. Prices in Depth of Market are close to the
market ones and therefore are considered as the best.
Fig.1 Depth of Market in MetaTrader 5
MetaTrader 5 an "order book" is named as the "Depth of Market" (Fig.1).
Detailed information about Depth of Market can be found in the User
Guide to the Client Terminal.
Author: Dennis Kirichenko
Just for information, there is a little error in this article :
All programs working with Depth of Market data will have a form of an
Expert Advisor, as only Expert Advisors feature the event handler of BookEvent.
There is a possibility, however, to write an "Expert-Indicator" pair ,
where the indicator can receive data from the EA and process the Depth
of Market state.
It's not true, indicators can also process BookEvent. This error is based on a documentation's error and should be corrected soon. The article's author and ServiceDesk have been contacted.