@ John Wu
The reason the numbers don't match (in places) is that you are fetching them at different times of the day. Specifically, all the daily data returned by 'get-pricing' in a notebook are end of day or close values. The data fetched by the algorithm using 'data.history' are as of the current minute.
So, looking at your algorithm output, this makes perfect sense...
2017-07-05 09:31 PRINT open high low close price volume
2017-07-03 00:00:00+00:00 125.0 125.04 124.020 124.418 124.418 7512425.0
2017-07-05 00:00:00+00:00 124.2 124.20 124.135 124.150 124.150 33861.0
As of 2017-07-05 09:31 the volume for the current day (ie 07-05) was 33861 shares. This is how many shares had traded through the first minute of trading that day (ie as of 9:31 am). The volume for the previous day (ie 07-03) was 7512425 shares and represent the total shares traded for that day.
Now let's look at the notebook price and volumes for those same two days...
open_price high low close_price volume price
2017-07-03 00:00:00+00:00 125.00 125.04 124.020 124.418 7512425.0 124.418
2017-07-05 00:00:00+00:00 124.20 124.65 124.115 124.470 10028780.0 124.470
Remember notebook data is end of day. So 2017-07-05 end of day volume was 10028780 shares. This doesn't match the algorithm volume because the algorithm volume was printed at 9:31am and NOT the end of day. However, the volume for the previous day (ie 07-03) was 7512425 shares and represent the total shares traded for that day and also matches exactly the value in the algorithm.
A lot of people would like at 9:31 in the morning to know the closing price for the day but no can do. Can't look into the future. There's no crystal ball. No lookahead bias.