# Missing market data bars

**URL:** <https://forum.alpaca.markets/t/missing-market-data-bars/2044>\
**Category:** Alpaca Market Data\
**Created:** [July 12, 2020, 3:24pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044 "2020-07-12T15:24:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickvd](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@nickvd](https://forum.alpaca.markets/u/nickvd)\
**Post date:** [July 12, 2020, 3:24pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/1 "2020-07-12T15:24:46Z")

</div>

Hello everyone,

I am new to Alpaca and I am working on a trading bot with a paper account to try out a strategy. When using the alpaca api to retrieve 15 minutes bars (tradeapi.get\_barset). I noticed there are quite a few missing data points. This is an example with ‘AAPL’. At the end it jumps from open time 15:45 to 16:30 the next bar. The same happens at other instances in time.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/f/f1b457d6f4076a541c77cd1418260ce3167a1cfa.png)

Is there anyone who can tell me what the cause of this is. Is it due to the fact that its outside of trading hours or are gaps in the data a common thing. Should I use the polygon integration to avoid this?

Any help is welcome!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![theakxis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/theakxis/32/71_2.png) [@theakxis](https://forum.alpaca.markets/u/theakxis)\
**Post date:** [July 21, 2020, 6:44am UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/2 "2020-07-21T06:44:29Z")

</div>

Hey there,

I noticed the exact same issue! I think this is def a problem on their end as there is missing data with the minute bars too…the polygon probably works but that’s only for non-paper accounts.

---

<div class="post-metadata">

**Author:** ![eloos10](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/eloos10/32/1075_2.png) [@eloos10](https://forum.alpaca.markets/u/eloos10)\
**Post date:** [July 27, 2020, 1:27pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/3 "2020-07-27T13:27:42Z")

</div>

I’ve noticed the same thing to! I hope they can get a fix going soon.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [July 27, 2020, 1:51pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/4 "2020-07-27T13:51:24Z")

</div>

some people dont understand when a stock price doesn’t move there is no new data point… think about that for a min!

---

<div class="post-metadata">

**Author:** ![nickvd](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@nickvd](https://forum.alpaca.markets/u/nickvd)\
**Post date:** [July 27, 2020, 3:05pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/5 "2020-07-27T15:05:53Z")

</div>

I am sorry not everyone is as smart as you, but I would like to know if this is THE cause so I can fill the blanks or if there is actual missing data and my bot is making decisions based on inaccurate data. This makes a lot of difference in the way these gaps should be treated.

---

<div class="post-metadata">

**Author:** ![melgazar9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/melgazar9/32/1082_2.png) [@melgazar9](https://forum.alpaca.markets/u/melgazar9)\
**Post date:** [July 29, 2020, 1:59pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/6 "2020-07-29T13:59:51Z")

</div>

Kris - if there is no price movement that means the bid and ask should be forward filled. Returning an NA or an empty cell is very misleading. The cell should be empty if everyone cancels their order and there’s nobody left in the market, not if there is no price movement. I also highly doubt this is the reason for missing bars since this data is made available for free. There’s a reason companies charge a minimum of $3k/mo for market data.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [July 30, 2020, 1:46pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/7 "2020-07-30T13:46:22Z")

</div>

you have a lot to learn.

---

<div class="post-metadata">

**Author:** ![melgazar9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/melgazar9/32/1082_2.png) [@melgazar9](https://forum.alpaca.markets/u/melgazar9)\
**Post date:** [July 30, 2020, 2:01pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/8 "2020-07-30T14:01:48Z")

</div>

Lol ok. Go look at algoseek or direct CME data and let me know if anything is missing.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [July 30, 2020, 2:03pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/9 "2020-07-30T14:03:40Z")

</div>

no thanks, im good…

---

<div class="post-metadata">

**Author:** ![melgazar9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/melgazar9/32/1082_2.png) [@melgazar9](https://forum.alpaca.markets/u/melgazar9)\
**Post date:** [July 30, 2020, 2:04pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/10 "2020-07-30T14:04:14Z")

</div>

Cool. Reliable market data vendors do not return missing data when no trades happen.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [July 31, 2020, 1:54pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/11 "2020-07-31T13:54:12Z")

</div>

btw your attitude is why your not making money, learn to accept advice

---

<div class="post-metadata">

**Author:** ![clecusay](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@clecusay](https://forum.alpaca.markets/u/clecusay)\
**Post date:** [July 31, 2020, 4:17pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/12 "2020-07-31T16:17:28Z")

</div>

All equity data providers that I have worked with, including 3k/mo data providers, do not return data when data is missing. Trading platforms also do not show minutes where there is no trading activity. The reason why CME data doesn’t have anything missing is because of the nature of the futures market being active all the time. If your algo needs liquidity to properly function, choose equities that have sufficient liquidity. Trading afterhours will always result in missing data.

You also are not getting NBBO data. You are getting 15 minute bar data. NBBO data would provide you with all of the best bid and offers for every moment in time. Two very very different things.

---

<div class="post-metadata">

**Author:** ![kuprel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kuprel/32/4663_2.png) [@kuprel](https://forum.alpaca.markets/u/kuprel)\
**Post date:** [November 12, 2022, 7:20pm UTC](https://forum.alpaca.markets/t/missing-market-data-bars/2044/13 "2022-11-12T19:20:59Z")

</div>

In pandas I found bfill to solve the problem, not ffill
