Are streaming data complete?

I have developed statistics based algorithm which compares historical “close and volume” with live “LTP and Volume” to get trade rules. I am facing two problems/confusions to implement these.

First problem I am facing is if I try to receive today’s daily bar, I get error that the time is too recent. I am on free account. Does unlimited account give un-closed today’s daily bar from where I can get LTP and Volume ?

Secondly, as a work around, I am planning to subscribe to live minute candle and aggregate the volume. Are the live stream minute bars from web socket complete or are they just samples ? Is the sum of volume from minute bars from the stream equals to the to the total volume for the day?

Other than that I can’t see how I can get live LTP and Volume for all the companies. Any pointers to the right direction would be great help.

The answer to the first question “Does an unlimited account give un-closed today’s daily bar from where I can get LTP and Volume?” Yes, the Alpaca ‘Unlimited’ data plan provides full market current trades and quotes. The ‘Free’ plan provides only trades and quotes from a single exchange (IEX) and also has a 15 minute delay. The ‘Free’ data plan is really meant for testing and debug and not meant for live trading.

The answer to the the second question “Are the live stream minute bars from web socket complete or are they just samples ? Is the sum of volume from minute bars from the stream equals to the to the total volume for the day?” is ‘yes’ and ‘no’. While the web socket streams all minute bars for a symbol (ie it is NOT a sample) if there is no bar to be generated at a specific time then no bar will be streamed. No bar will be generated if there were no ‘valid’ trades during a particular minute. There may have been trades, but if none were ‘valid’ then no bar. This leads to the second half of the question. There can (and often is) a situation where trades exist which add to volume but are not valid for calculating prices. In this case, no bar is generated. The volume for those trades then isn’t accounted for if summing the minute data. It will be included in the daily bar, but the sum of the minute bars may be less volume than the actual daily volume.

To get a lot of information, including current quote and last bar, consider using the [snapshots](https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/historical/#snapshot---multiple-tickers) API. One can fetch multiple symbols at a time and get a plethora of data.

Hope that helps.

2 Likes