Tick Volume different to MQL tick volume

 

When analysing the GBPUSD chart with 1h bars, I noticed that the tick volume shown for each bar is higher than the tick volume you get through MQL.


I expect those 3 to be the same:

A) Tick volume for a 1h bar in the chart

B) #ticks after we call CopyTicksRange with COPY_TICKS_ALL and `from_msc` and `to_msc` set to match the same 1h bar.

C) Counting all ticks we receive in `OnTick` that fall in inside the same 1h bar.


B and C are identical but A is different. Specifically, A is consistently higher and never lower, which eliminates the possibility of some weird shift going on. If MQL returns 1268 ticks, the chart shows 1277. For the next bar MQL returns 1899 while the chart shows 1910. And so on.


This is run in the backtesting mode on symbol GBPUSD in demo mode, modelling "Every Tick" and zero latency set.


What causes this discrepancy?