Stock exchange broker's tick data has the volume field populated in non-trade events. What does it mean?

 
Hello,

I've been examining the discrepancies in my algorithm's behavior between the tick data from two different Brazilian stock exchange brokers, and I've pinpointed the cause:

 

The image above shows the Broker 1 log on the left and the Broker 2 log on the right.

In both logs, events 56 (buy aggression) and 88 (sell aggression) are virtually identical 99.9% of the time.

The BID/ASK change events (highlighted in the red rectangle above) also align almost perfectly in terms of timestamps and prices. However, there are significant differences in the flags and volume.

The Broker 1 MT5 server appears to trigger the TICK_FLAG_BUY (value 32) and TICK_FLAG_VOLUME (value 16) in conjunction with the TICK_FLAG_BID (value 2), resulting in a total of 50 in the "Flags" field. This occurs in events where the Broker 2 MT5 server only triggers the TICK_FLAG_BID (value 2).

Similarly, it seems to trigger the TICK_FLAG_SELL (64) and TICK_FLAG_VOLUME (16) along with the TICK_FLAG_ASK (4), adding up to 84 in the "Flags" field. This happens in events where the Broker 2 MT5 server only triggers the TICK_FLAG_ASK (value 4).

What really puzzles me are the values that Broker 2 populates in the "Volume" field (10, 191, 2, and 466 as shown in the image above), as if there was trading activity during these events, whereas Broker 2's log suggests that there were only BID/ASK changes.

I've checked the stock exchange log and confirmed that there were indeed no trades executed during these events. There were only BID/ASK changes, which would suggest that the Broker 2's log is the accurate one.

However my algorithm's performance consistently and reproducibly improves when these volumes with flags 50 and 84, exclusive to Broker 1, are factored into the calculation of the indicators used in my predictive model. This suggests that this information must hold some significance.

After a more in-depth analysis, I've discovered that these volumes seem to align with the volumes listed in the order book at the BID price level when flags are set to 50 (TICK_FLAG_BUY activated), and at the ASK price level when flags are set to 84 (TICK_FLAG_SELL activated).

Does anyone can confirm what these volumes actually represent?

Is the difference between brokers due to different settings in their MT5 servers?

Is there any "server-side" documentation on how these tick flags can be configured by the broker?

Thank you in advance.

 
Trader_Patinhas:
...

Broker 1 data on the bid/ask ticks are obviously wrong. The volume field is intended to provided the real volume (volume for BUY/SELL deals). It's not intended to provide order book volume.

The difference is due to the broker which didn't configure his server correctly (maybe intentionally to provide the bid/ask order book volume in a strange way, maybe by error).

The server-side is not publicly documented, you should talk to this broker.

struct MqlTick
  {
   datetime     time;          // Time of the last prices update
   double       bid;           // Current Bid price
   double       ask;           // Current Ask price
   double       last;          // Price of the last deal (Last)
   ulong        volume;        // Volume for the current Last price

   long         time_msc;      // Time of a price last update in milliseconds
   uint         flags;         // Tick flags
   double       volume_real;   // Volume for the current Last price with greater accuracy
  };

 
Alain Verleyen #:

Broker 1 data on the bid/ask ticks are obviously wrong. The volume field is intended to provided the real volume (volume for BUY/SELL deals). It's not intended to provide order book volume.

The difference is due to the broker which didn't configure his server correctly (maybe intentionally to provide the bid/ask order book volume in a strange way, maybe by error).

The server-side is not publicly documented, you should talk to this broker.

Thank you, Alain.

I tried chatting with the broker, but it's like they're clueless about what I'm saying. I guess their MT5 server was probably set up by some outside contractor who's no longer available.

Reason: