When summing trade volume from reqTickByTickData("AllLast", ignoreSize=False) over a set period, totals often don’t match TWS Time & Sales for the same symbol/time?
No - it is not a timezone issue. I see it live: the API’s volume threshold is met while TWS Time & Sales shows much lower volume.
The IB API, that abomination. Have you tried comparing results from AllLast and Last? "AllLast has additional trade types such as combos, derivatives, and average price trades, which are not included in Last" They might be sending averages as well in the lot, so you have to curate the data before using it. I just checked my code, and I am using Last. I think I had problems with the rest of the parameters, and I wasn't happy with the result. Which market are you trying to get the data from? Maybe we can throw a quick test as well.
I’m already using Last (not AllLast). Despite that, I still see higher API volume than TWS Time & Sales in real time (no timezone issue). US equities.
Since you said in your initial post that you were using AllLast that is why I mentioned that. Anyway, as far as I understand, the API sends you raw data, and the Time and Sales window displays aggregated data, as per this post: https://www.ibkrguides.com/traderworkstation/time-and-sales.htm So I don't think that you can compare both. "The "+" in front of a tick indicates aggregated ticks over a certain timeframe, which we implement during an active market. Mouse over the "+" to view the total number of aggregated ticks."
I am actually not using AllLast or Last. I am using the standard market data feed (top‑of‑book) that updates ticker.last / ticker.lastSize.