MT5 - MQLBookInfo problems

 

Hello,

I'm writing a code for futures market and I need bid/ask prices with quotations(volumes) in each price depth.

I managed to get the correct values for ask and bid but I have two problems:

1-) I need to keep opened "Depth of Market"  windows in order to get prices. I'm willing to get many symbol's values so it's not practical to open so many "depth of market" windows on terminal. Is there a way to handle it without opening the windows?


2-) I'm running the code onTick() however the prices are printed with a delay of aprox 1sec comparing "depth of market" data. I tested OnBookEvent() but it didn't work. When put in a infinite loop onTick()  it works perfectly without delay but it's not convenient to use such a loop since it blocks the system. Any suggestion to get market depth values real-time?


Thanks in advance

 
I've solved the 2nd issue by MarketBookAdd() function