Metatrader 5 Market Depth

 

I'm new to metatrader 5 and MQL I was wondering if someone knew what was necesary to do in order to be able to use Market depth information?  

 I also tried using MarketBookGet() on and EA using the example in the docs

MqlBookInfo priceArray[];
bool getBook=MarketBookGet(NULL,priceArray);
if(getBook)
{
int size=ArraySize(priceArray);
Print("MarketBookInfo about ",Symbol());
}
else
{
Print("Failed to receive DOM for the symbol ",Symbol());
}

having put MarketBookAdd() in the OnInit() function. But it always goes to the part of Failed to receive DOM

I also read that it had to be in exchange execution mode how do I do that?  

 

 Im new to MQL thanks in advance for your help. 

Documentation on MQL5: Market Info / MarketBookGet
  • www.mql5.com
Market Info / MarketBookGet - Documentation on MQL5
 
serfadeveloper:

I'm new to metatrader 5 and MQL I was wondering if someone knew what was necesary to do in order to be able to use Market depth information?  


Did you use the MarketBookAdd() function?
 

Yes I used it. So far what i think it might be is that i need to be in the exchange execution mode but i still don't know what does that means in terms of what needs to be done or if it depends on the type of account.

Is this mode established by the broker? type of account? 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Symbol Properties - Documentation on MQL5
 
serfadeveloper:


Is this mode established by the broker? type of account? 

Yes, you need a broker who provides symbols with Market Depth.
Reason: