Help with Barset

Using the get_barset method will fetch data from IEX (Investors Exchange LLC). Basically, IEX data is available to all Alpaca users but doesn’t include trades from all exchanges (so volume, for example, may be less than the total traded across all exchanges/venues). That is why the volumes indicated above do not match the chart. There is a better explanation in this post.

To get volumes closer to what is reported on sites like Yahoo and Google, use Polygon data. (However, it’s only available if you subscribe to the data or have a live account). Something like this

polygon_data = api.polygon.historic_agg_v2(symbol='AAPL',
                            multiplier=1,
                            timespan='day',
                            _from='2020-11-1',
                            to='2020-11-18')

This shows a volume on 11-19 which is a bit higher than what’s on the chart. Actually, Polygon data is more inclusive than most sites because not only does it record volumes from all the major exchanges but also ‘dark pools’ (which act as private exchanges). Most sites (even including NASDAQ) do not include this ‘dark pool’ volume which can be quite a bit at times. Here is a quote from the Polygon documentation…

We include all 16 public exchanges + dark pools. Our feed contains 100% market volume for US trading.

Hope that helps?