New article – MQL5 Cookbook: Handling BookEvent

Back to topics list To post a new topic, please log in or register
MetaQuotes 2014.10.22 13:22

New article MQL5 Cookbook: Handling BookEvent has been published at

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.

1. BookEvent

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.

Depth 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

Fig.1 Depth of Market in MetaTrader 5

In 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

Back to topics list  

To add comments, please log in or register