My quick research prove substantial difference Quantopian's volume data not only with Yahoo history but between two different ways you take it.
def initialize(context):
schedule_function(record_volume, date_rules.every_day(), time_rules.market_close())
def record_volume(context,data):
stock = symbol('AAPL')
v = data.current(stock, 'volume')
V1 = data.history(stock, 'volume', 5, '1d').iloc[-1]
print (V1, v)
Log output
2018-06-01 12:59 PRINT (18278742.0, 320402L)
2018-06-04 12:59 PRINT (21159162.0, 93367L)
2018-06-05 12:59 PRINT (16661532.0, 206261L)
2018-06-06 12:59 PRINT (14113150.0, 115111L)
2018-06-07 12:59 PRINT (14982271.0, 118309L)
2018-06-08 12:59 PRINT (19403342.0, 170845L)
2018-06-11 12:59 PRINT (14360539.0, 94633L)
2018-06-12 12:59 PRINT (12564678.0, 145482L)
2018-06-13 12:59 PRINT (14751124.0, 209466L)
2018-06-14 12:59 PRINT (15145759.0, 212633L)
2018-06-15 12:59 PRINT (27315535.0, 263323L)
Yahoo Quote
https://finance.yahoo.com/quote/AAPL/?p=AAPL
At close: June 15 4:00PM EDT Volume 33,104,035
Yahoo history
https://finance.yahoo.com/quote/AAPL/history?p=AAPL
Date Volume
2018-06-01 23,250,400
2018-06-04 26,132,000
2018-06-05 21,566,000
2018-06-06 20,933,600
2018-06-07 21,347,200
2018-06-08 26,656,800
2018-06-11 18,308,500
2018-06-12 16,911,100
2018-06-13 21,638,400
2018-06-14 21,610,100
2018-06-15 61,289,600
WHY?