Alpaca Bar set not reflecting data correctly

Hi
I was cross checking some of the barset data pulled using alpaca api.barset for every 1min and 5min for CIDM stock, this is what i get. Any ideas what would be the problem here. Or “Alpaca please fix this”
I am expecting all the enteries for OCT 25, below rows are my latest data
time open high low close volume
2019-10-09 10:20:00-04:00 1 1 1 1 100
2019-10-16 10:00:00-04:00 0.8401 0.8401 0.8401 0.8401 300
2019-10-16 10:05:00-04:00 0.8401 0.8401 0.8401 0.8401 100
2019-10-21 15:20:00-04:00 1.02 1.02 1.01 1.01 200

Please keep in mind that not all ticker symbols at every minute has the price bar. If the name was not traded during the time window, the bar data isn’t generated. CIDM is small volume stock and it is possible that bars are sparse.

Thanks Hitoshi. I understand, i cross checked with yahoo stocks, which showed there were some price changes which made me think barsets did not populate correctly. See screenshot below:

1 Like

Adding on to this old thread -
I’ve noticed a lot of gaps in data.

I’m pulling the last 10 minutes of trades for DIS, one of the largest cap, most traded stocks.

The barset is clearly incomplete / missing data (see below), with a two minute gap, a five minute gap, and a six minute gap.

Is this data from IEX only the trades and volumes on IEX (versus market trades and market volume)?

DIS

open high low close volume
time
2019-12-26 12:28:00-05:00 145.235 145.235 145.235 145.235 100
2019-12-26 12:29:00-05:00 145.270 145.270 145.270 145.270 6
2019-12-26 12:30:00-05:00 145.210 145.210 145.200 145.200 309
2019-12-26 12:32:00-05:00 145.225 145.230 145.210 145.210 900
2019-12-26 12:37:00-05:00 145.345 145.345 145.345 145.345 10
2019-12-26 12:38:00-05:00 145.380 145.380 145.380 145.380 100
2019-12-26 12:39:00-05:00 145.400 145.400 145.390 145.395 500
2019-12-26 12:45:00-05:00 145.425 145.430 145.425 145.430 147
2019-12-26 12:47:00-05:00 145.450 145.450 145.450 145.450 100
2019-12-26 12:50:00-05:00 145.480 145.480 145.480 145.480 20

Yes, that’s the issue with IEX. They have a lot of free data, but the price data is only what is traded through them.

IEX Cloud provides real time prices, volume, and quotes for all NMS US securities; sourced from the Investors Exchange.

You can use polygon to get the trades volume which are pulled from various other exchanges
Here is how to do that:

import datetime
ENDPOINT ='https://api.alpaca.markets'
api = alpaca.REST(KEYID, SECRETKEY, ENDPOINT)
df = api.polygon.historic_agg_v2('AAPL', 1, 'day', '2014-10-28',str(datetime.date.today()),False,limit=10).df

This returns a dataframe with last 10 transactions. You can also have dataframe pulled based on the from and to dates only:

    df = api.polygon.historic_agg_v2('AAPL', 1, 'day', '2014-10-28', '2015-10-28', False).df

To use polygon you must have alpaca’s live trading account. Here is the detailed information listed here : https://github.com/alpacahq/alpaca-trade-api-python

Hope this helps.