When is the daily bar first available?

The documentation says

A daily bar is returned as partial bar up to the current time and updates only at the first valid trade of the day.

When I last tried listening to the daily bar stream, the first daily bar was only sent at the close of the first minute; however, the documentation suggests that the first daily bar should be sent immediately after receiving the opening trade. Is the documentation incorrect or is there a bug in Alpaca’s implementation?

@08.fortes.waxen

The key here is that both the minute bars and the daily bars are calculated at the end of each minute. The minute bars contain the trades in the minute, and the daily bars contain the trades that day up until that point.

the first daily bar was only sent at the close of the first minute

Yes, the first possible daily bar is sent out at 9:31 and contains the trades until that point.

the documentation suggests that the first daily bar should be sent immediately after receiving the opening trade

Your quotation doesn’t suggest this. If you read it somewhere else, please provide a link.

1 Like

Thanks for the confirmation.

This is the part of the sentence that made me think that the daily bar would be sent immediately after receiving the opening trade: “updates only at the first valid trade of the day”. Perhaps it would be clearer for the documentation to say “A daily bar is returned as a partial bar at the end of each minute. The daily bar is only available after the first valid trade of the day.”?

That being said, it would be useful if a partial daily bar was sent immediately after the opening trade was received so that a strategy that relies on the day open price doesn’t need to wait until the end of the first minute to execute.