-
-
Notifications
You must be signed in to change notification settings - Fork 89
Description
It appears looking at the code that there's no way to receive Bar updates (revisions to a previously returned Bar that has changed due to late settling trades). Would it be possible to add?
From Alpaca's Documentation
Their documentation shows that at the 30s mark it should be possible to receive a revised Bar object (source real-time-stock-pricing-data)
Minute Bars (bars)
Minute bars are emitted right after each minute mark. They contain the trades from the previous minute. Trades from pre-market and aftermarket are also aggregated and sent out on the bars channel.
Note: Understanding which trades are excluded from minute bars is crucial for accurate data analysis. For more detailed information on how minute bars are calculated and excluded trades, please refer to this article Stock Minute Bars.
Updated Bars (updatedBars)
Updated bars are emitted after each half-minute mark if a “late” trade arrived after the previous minute mark. For example if a trade with a timestamp of 16:49:59.998 arrived right after 16:50:00, just after 16:50:30 an updated bar with t set to 16:49:00 will be sent containing that trade, possibly updating the previous bar’s closing price and volume.
| Attribute | Type | Description |
|---|---|---|
| T | string | message type: “b”, “d” or “u” |
| S | string | symbol |
| o | number | open price |
| h | number | high price |
| l | number | low price |
| c | number | close price |
| v | int | volume |
| t | string | RFC-3339 formatted timestamp |
Example
{
"T": "b",
"S": "SPY",
"o": 388.985,
"h": 389.13,
"l": 388.975,
"c": 389.12,
"v": 49378,
"t": "2021-02-22T19:15:00Z"
}