Using MarketBookGet() without subcribing to market book

 

Hello folks!

According to documentation, MarketBookGet() has to be used after the EA was subscribed to book using MarketBookAdd(). So, we have the event OnBookEvent() always when the book changes.

What happens if I use MarketBookGet() without subscribing, out of OnBookEvent()? I think about optimizing my EA because in my strategy I don't need all book changes, I just do some verifications eventualy.

If I use MarketBookGet() without subscribing, is the information reliable?

I will get the last state of the book?

 
You need to subscribe to get real data. You can subscribe, receive one event, then unsibscribe. Or you can subscribe and then just skip unwanted events - I don't think this will degrade performance of your EA.
 
Stanislav Korotky:
You need to subscribe to get real data. You can subscribe, receive one event, then unsibscribe. Or you can subscribe and then just skip unwanted events - I don't think this will degrade performance of your EA.

The point is: how to identify an auction during the day?
I don't want to open or close positions while the stock market is in auction.

Take a look at the book:

This situation is very ease to identify using MarketBookGet(), but in "slow" markets I want to get the book imediatly, I can not wait for a OnBookEvent(). So, this is why I did the question "If I use MarketBookGet() without subscribing, is the information reliable?"