m.stocks.bars¶
Aggregate bars (open, high, low, close, volume) of US-listed stocks.
Call it from a session m, made with dm.MassiveSession():
m.stocks.bars(symbols, timespan, *, multiplier=1, adjusted=True, on_error=None)
- Methods:
history(start, end=None); for 1-second and 1-minute bars at multiplier=1 alsoblink(),append_only(),ring(capacity),last_by(by='Symbol') - Read from: REST, flat files, WebSocket
Arguments¶
A linked argument follows its rule under shared arguments on the dataset index.
| Argument | Description |
|---|---|
symbols |
Stock tickers, or dm.ALL. |
timespan |
The bar's unit. Massive refuses dm.Timespan.SESSION, a futures unit. |
multiplier |
Units per bar. |
adjusted |
Adjusts volume as well as prices. |
on_error |
What a bad symbol or row does in this call (dm.ErrorPolicy). None, the default, takes each cause from the session's MassiveConfig.on_error. |
Plans¶
How recent the data is on each of Massive's plans, and how far back its history goes, as Massive's pages state them.
| Plan | Day Aggregates (flat files) | Minute Aggregates (flat files) | Custom Bars (OHLC) (REST) | Daily Market Summary (OHLC) (REST) | Aggregates (Per Minute) (WebSocket) | Aggregates (Per Second) (WebSocket) |
|---|---|---|---|---|---|---|
| Stocks Basic | Not included | Not included | End-of-day, 2 years | End-of-day, 2 years | Not included | Not included |
| Stocks Starter | End-of-day, 5 years | End-of-day, 5 years | 15-minute delayed, 5 years | 15-minute delayed, 5 years | 15-minute delayed | 15-minute delayed |
| Stocks Developer | End-of-day, 10 years | End-of-day, 10 years | 15-minute delayed, 10 years | 15-minute delayed, 10 years | 15-minute delayed | 15-minute delayed |
| Stocks Advanced | End-of-day, All history | End-of-day, All history | Real-time, All history | Real-time, All history | Real-time | Real-time |
| Stocks Business | End-of-day, All history | End-of-day, All history | Real-time, All history | Real-time, All history | Real-time | Not included |
| Stocks Business + Expansion | Real-time |
Columns¶
| Column | Type | Description | Read from |
|---|---|---|---|
Symbol |
String | The row's instrument, as Massive's ticker. From REST: the request's stocksTicker parameter; REST T: "The exchange symbol that this item is traded under."; flat files ticker: "The exchange symbol that this item is traded under."; WebSocket sym: "The ticker symbol for the given stock." |
REST, flat files, WebSocket |
Date |
String | The trading day of the bar, as ISO yyyy-MM-dd text: the New York date of TimestampStart for an intraday or 1-day bar, and null for a bar that spans more than one date (several days, a week or longer, or an intraday bar that crosses midnight). Joining an intraday row to the same day's daily bar on Date attaches values not known until that day ended, and a null Date matches another null, so join longer bars on TimestampEnd. |
REST, flat files, WebSocket |
TimestampStart |
Instant | The start of the bar's window, as an Instant. A bar of a day or longer starts at 00:00 New York time of its window's first day (a week's Monday, a month's, quarter's, or year's first weekday), whichever source serves it. A bar of a day or longer stamped at a time or on a day Massive is not known to use is withheld, with a WARNING, since which day it covers is not known. Every other stamp, as each source sends it (quoted next), is moved there. From REST /v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to} t: "The Unix millisecond timestamp for the start of the aggregate window."; REST /v2/aggs/grouped/locale/us/market/stocks/{date} t: "The Unix millisecond timestamp for the end of the aggregate window."; flat files window_start: "The Unix nanosecond timestamp for the start of the aggregate window."; WebSocket s: "The start timestamp of this aggregate window in Unix Milliseconds." |
REST, flat files, WebSocket |
TimestampEnd |
Instant | The exclusive end of the bar's window, as an Instant: the first instant at which the bar is complete, so an as-of join on it, t.aj(bars, on=["Symbol", "Timestamp>=TimestampEnd"]), never attaches a bar that is still open. It is when the window closes, not when Massive published the bar, and Massive may correct a bar later. An intraday bar ends at Massive's e where the WebSocket sends one, else its length after its start; a WARNING says when the two differ. A bar of a day or longer ends at 00:00 New York time after its window's last day. A row read before its window ended has TimestampInsert before TimestampEnd, and its values can still change; t.where("TimestampEnd <= TimestampInsert") keeps only the rows read after their window ended. That test reads the local clock, which can be off, and a row read within moments of its end, or from a delayed feed, may still lack the window's last trades. |
REST, flat files, WebSocket |
Open |
double | The open price for the symbol in the given time period. Split-adjusted when the query's adjusted is True, the default, served only by REST: a price from before a split is restated in the split's terms (divided by its ratio), so it is not the price that traded. With adjusted=False, from the flat files, and on the WebSocket it is as traded. One history() never mixes the two, and Massive never adjusts for cash dividends. | REST, flat files, WebSocket |
High |
double | The highest price for the symbol in the given time period. Split-adjusted when the query's adjusted is True, the default, served only by REST: a price from before a split is restated in the split's terms (divided by its ratio), so it is not the price that traded. With adjusted=False, from the flat files, and on the WebSocket it is as traded. One history() never mixes the two, and Massive never adjusts for cash dividends. | REST, flat files, WebSocket |
Low |
double | The lowest price for the symbol in the given time period. Split-adjusted when the query's adjusted is True, the default, served only by REST: a price from before a split is restated in the split's terms (divided by its ratio), so it is not the price that traded. With adjusted=False, from the flat files, and on the WebSocket it is as traded. One history() never mixes the two, and Massive never adjusts for cash dividends. | REST, flat files, WebSocket |
Close |
double | The close price for the symbol in the given time period. Split-adjusted when the query's adjusted is True, the default, served only by REST: a price from before a split is restated in the split's terms (divided by its ratio), so it is not the price that traded. With adjusted=False, from the flat files, and on the WebSocket it is as traded. One history() never mixes the two, and Massive never adjusts for cash dividends. | REST, flat files, WebSocket |
Volume |
double | The trading volume of the symbol in the given time period. Split-adjusted like the prices when the query's adjusted is True, the default, served only by REST: a volume from before a split is restated in the split's terms (multiplied by its ratio). With adjusted=False, from the flat files, and on the WebSocket it is as traded. | REST, flat files, WebSocket |
Vwap |
double | The volume weighted average price. Split-adjusted when the query's adjusted is True, the default, served only by REST: a price from before a split is restated in the split's terms (divided by its ratio), so it is not the price that traded. With adjusted=False, from the flat files, and on the WebSocket it is as traded. One history() never mixes the two, and Massive never adjusts for cash dividends. | REST, WebSocket |
Transactions |
long | The number of transactions in the aggregate window. | REST, flat files |
Otc |
Boolean | Whether or not this aggregate is for an OTC ticker. This field will be left off if false. | REST, WebSocket |
DecimalVolume |
String | The tick volume including fractional shares, respresented as a string decimal number | WebSocket |
AccumulatedVolume |
long | Today's accumulated volume. | WebSocket |
AccumulatedDecimalVolume |
String | Today's accumulated volume including fractional shares, respresented as a string decimal number | WebSocket |
OfficialOpen |
double | Today's official opening price. | WebSocket |
DayVwap |
double | Today's volume weighted average price. | WebSocket |
AverageTradeSize |
long | The average trade size for this aggregate window. | WebSocket |
TimestampInsert |
Instant | When the library received the row, by the local clock. Rows that arrive together share it. It isn't Massive's time, and later rows can carry earlier times. On history() rows, it's the download time. |
REST, flat files, WebSocket |
Massive fields
The Massive field behind each column, by source. An empty cell means the source doesn't carry the column, or the library computes it. request marks a value the library fills from the request.
| Column | REST field | Flat-file field | WebSocket field |
|---|---|---|---|
Symbol |
request, T |
ticker |
sym |
Date |
|||
TimestampStart |
t |
window_start |
s |
TimestampEnd |
e |
||
Open |
o |
open |
o |
High |
h |
high |
h |
Low |
l |
low |
l |
Close |
c |
close |
c |
Volume |
v |
volume |
v |
Vwap |
vw |
vw |
|
Transactions |
n |
transactions |
|
Otc |
otc |
otc |
|
DecimalVolume |
dv |
||
AccumulatedVolume |
av |
||
AccumulatedDecimalVolume |
dav |
||
OfficialOpen |
op |
||
DayVwap |
a |
||
AverageTradeSize |
z |
||
TimestampInsert |
Massive's documentation¶
- Day Aggregates (flat files)
- Minute Aggregates (flat files)
- Custom Bars (OHLC) (REST)
- Daily Market Summary (OHLC) (REST)
- Aggregates (Per Minute) (WebSocket)
- Aggregates (Per Second) (WebSocket)
The plan tables and most column descriptions are Massive's, from its documentation as fetched on 2026-12-01, with a few corrected where Massive's are wrong. The library writes its own descriptions of the columns it names or computes, such as Symbol and TimestampInsert.