EA using DOM on MT5

 

Hello everyone,

I have a few questions about Depth of Market / order book data on MetaTrader 5.

I am currently testing an EA idea based on DOM / order book imbalance, using MQL5 functions such as:

- MarketBookAdd()

- MarketBookGet()

- OnBookEvent()

On MT5, I can visually open the DOM window on many symbols, but I am not sure whether this always means that the data is usable inside an Expert Advisor.

My main questions are:

1. If the DOM window is visible on MT5, does it necessarily mean that an EA can access usable bid/ask levels and volumes through MarketBookGet()?

2. Is there usually a difference between demo accounts and real accounts regarding DOM availability, depth, update frequency, or volume quality?

3. Does anyone have experience with DOM data on IC Markets MT5 specifically, either demo or real?

4. Is it realistic to code an EA based on DOM / order book imbalance on MT5, or is the DOM data often too limited/unreliable depending on the broker and symbol?

I am trying to understand whether it is technically possible to build a robust EA using the DOM data available through MT5, and what limitations I should expect.

Thanks in advance for any feedback or experience.

MM




 
The major differences are between exchange listed instruments and off-exchange/OTC instruments:
  • If an instrument is traded in the exchange mode, in which related trading operations are sent to an external trading system (an exchange), the DOM features real prices and order volumes from market participants.
  • If an instrument is traded in the over-the-counter (OTC) market, the Depth of Market can be formed based on the quotes of the broker, who may provide different prices depending on the buy or sell volume. If the broker does not provide volumes, the DOM window functions as a scalping tool, which allows placing of market and pending orders with a single click. In this case, the Depth of Market displays price levels calculated based on the Bid and Ask prices using the price change step. (https://www.metatrader5.com/en/terminal/help/trading/depth_of_market).
 

I am trying to understand whether it is technically possible to build a robust EA using the DOM data available through MT5, and what limitations I should expect.


Using DOM is possible technically, but you should note that it's not supported in the tester, and there is no such thing as a history of DOMs from a broker.

You need either (1) collect DOM-s online yourself for a quite some time and then translate them to your EA in the tester by means of some auxiliary code or (2) use a ready-made product which do it for you.

Without this you can't optimize your EA.

DOM-based EAs are good for exchanges only.