Daily volume discrepancy between IB and Yahoo

Hi,

I found there are huge difference for volume data between QuantRocket/IB and others. I have listed recent volume data for AAPL for comparing:

QuantRocket/IB
Date Volume
2018-09-10 7455200.0
2018-09-11 6246700.0
2018-09-12 8416800.0
2018-09-13 6709200.0
2018-09-14 5340300.0

Yahoo
|Date|Open|High|Low|Close*|Adj Close**|Volume|
|Sep 14, 2018|225.75|226.84|222.52|223.84|223.84|31,902,700|
|Sep 13, 2018|223.52|228.35|222.57|226.41|226.41|41,706,400|
|Sep 12, 2018|224.94|225.00|219.84|221.07|221.07|49,278,700|
|Sep 11, 2018|218.01|224.30|216.56|223.85|223.85|35,749,000|
|Sep 10, 2018|220.95|221.85|216.47|218.33|218.33|39,516,500|

Any comment?

It looks like you created your database with the --primary-exchange filter. Thus, what you're seeing is expected: Yahoo is reporting consolidated volume, while QuantRocket/IB is reporting only the volume that traded on NASDAQ. Without --primary-exchange the volume numbers should be more similar, however they still aren't expected to match exactly because IB reports in 100-lots (rounds mixed lots and excludes odd lots) while Yahoo reports actual shares. See the TWS user group for more discussion.

Thank you so much for the answer!

I found a additional field RTVolume in TWS API which including odd lots and derivative trades, I would like to access this field in QuantRocket, can you advise?

RTVolume is part of IB's real-time data API, which is not yet available in QuantRocket but planned for late 2018/early 2019.

Is this discrepancy expected for prices as well?
I don't mean to split-hairs, but noticed the 15:30:00 close bar on SPY in IB is 251.84, where as other sources are reporting 251.83.

Vendors can report different prices for many reasons. The same factors that affect volume will also affect price (since every trade involves some volume of shares at some price). In fact I’ve never found 2 datasets that always agreed. Keep in mind that bars are artificial aggregates constructed from streams of raw trades, and many variables are at work. To name a few: are the trades from the primary exchange only or consolidated from multiple exchanges? (That’s a big one.) Are odd lots included? Block trades? Which trade conditions did the vendor filter out? Did the vendor round dividends then apply them, or apply them all then round the resulting price? An end-of-day price and the last RTH intraday price might differ because the cutoff used for determining what's RTH might be different. Etc. etc.

1 Like

Hey Brian, figured that was the case. Thanks for taking the time to spell it out.