MT4 Orderbook consitency

 

Hello,

We handle large amount of orders and it is crutial to have the order book in a valid state.

Lets take the OrdersTotal();  OrdersHistoryTotal(); OrderSelect(); functions,and data they get

from the broker as an example.

My question is, if the order book changes (trade is executed/cancelled/filled)

within the scope of onTick() being executed, is the Order book updated asynchronously

and the updated state available within the same onTick still running, or is it updated

only after the current onTick is finished?

For example the flow:

1. onTick() event is launched

2. OrdersTotal returns 10 trades

3. A new pending order is created within the onTick scope

4. The subsequent call of OrdersTotal returns 11 trades? or it is updated AFTER the onTick is finished?

Reason: