CryptoHistoricalDataClient returning incomplete data

Hi, I’m new here and testing out Alpaca’s API. I’m getting strange and sparse data from todays request for BTC/USD minute bars. Many minutes are missing and others appear to have a single trade with zero volume. I can’t imagine Alpaca would have such incomplete market data for something as popular as Bitcoin, but at the same time I’m not really sure what I could have messed up in the API request.

I’m currently using the paper trader API. Could someone help me make sense of this?

                      Close        Open        High         Low    Volume

timestamp
2024-05-26 00:08:00 69244.1030 69244.1030 69244.1030 69244.1030 0.000000
2024-05-26 00:10:00 69238.1770 69231.4845 69245.9500 69221.2435 0.000000
2024-05-26 00:14:00 69229.6665 69229.6665 69229.6665 69229.6665 0.000000
2024-05-26 00:16:00 69228.3755 69253.8560 69253.8560 69223.5200 0.000017
2024-05-26 00:20:00 69203.8400 69217.7800 69217.7800 69203.8400 0.000000
… … … … … …
2024-05-26 18:13:00 68725.3000 68725.3000 68725.3000 68725.3000 0.000000
2024-05-26 18:16:00 68747.8850 68747.8850 68747.8850 68747.8850 0.000000
2024-05-26 18:18:00 68723.1950 68723.1950 68723.1950 68723.1950 0.000000
2024-05-26 18:22:00 68710.3200 68681.2960 68710.3200 68681.2960 0.000800
2024-05-26 18:23:00 68692.7800 68710.7050 68710.7050 68692.7800 0.000000

[378 rows x 5 columns]

@Eric_Risser Since Alpaca executes all crypto orders in its own exchange, the crypto market data endpoints only return data from trades executed on Alpaca and do not include other exchanges. If there were no trades during a specific minute bar then generally no bar will be generated. However, at times in the case of no trades, the prices will be determined by the midpoint of the current quote and the volume will be 0. That is why you 1) may see fewer bars than expected or which you see on other exchanges and 2) may see a bar with 0 volume.

Does that explain it?

Ah yes, that all makes perfect sense. Thank you! I’m new to Crypto, didn’t realize each broker is a private exchange.

1 Like