Quote from Andrew Kirillov:
The real big issue is illustrated in the example below:
[ 12:49:20 ] Total Volume= 13341
[ 12:49:29 ] LastSize= 1
[ 12:49:29 ] Total Volume= 13342
[ 12:49:33 ] Total Volume= 13343
You can see that we have 1 last size, but actually total volume changed twice. So we must generate two trades instead of 1 as we would conclude according to ONE last size message.
This is the basic issue with IB real-time
OK, I see. If you are trying to extract ticks and started with volume 13341, you would then have to add one tick for each volume change. You would NOT add a tick just because LastSize=1 was sent, unless a) The LastSize is different from previous LastLize sent on the security and b) there is a corresponding TotalVolume change.
IB by design is not a tick by tick datafeed and you are not guaranteed to get every event. The example you gave is not a problem with the data. At least from the point of view that its working as intended.
Had you received something like this:
[ 12:49:20 ] LastSize= 1
[ 12:49:20 ] Total Volume= 13341
[ 12:49:29 ] LastSize= 2
[ 12:49:29 ] LastSize= 1
[ 12:49:29 ] Total Volume= 13349
[ 12:49:33 ] Total Volume= 13350
then you could interpret that at least 4 trades occured after the 13341 volume, since LastSize actually changed.
Trade 1 - LastSize change to 2
Trade 2 - LastSize Change to 1
Trade 3 - Change in volume from 13341 to 13349 is 8 contracts. The 2 assumed trades total 3 contracts. Therefore there was at least one other trade for 5 contracts (or multiple trades, you cannot tell)
Trade 4 - Change in Volume to 13350
Jerry Medved
http://www.quotetracker.com