quantlab.dataset.massive.news#
Massive’s news as a daily count and sentiment panel on the permaticker axis (#357).
Massive’s /v2/reference/news articles, as MassiveClient.pull keeps
them in the REST raw tier (quantlab.dataset.massive.raw.rest_page_files),
become four variables on SEP’s trading calendar, one column per permaticker:
news_count: the articles naming the security that count on the day;news_positive,news_negative,news_neutral: those of them whose per-tickerinsightssentiment for the security is that label. An article without an insight for the ticker is counted innews_countonly.
A cell without an article is 0. An article counts on the trading day of
its published_utc in New York time when published before that
session’s close, and on the next trading day when published at or after the
close or on a day without trading, so news after the close never reaches the
day’s bar. The close is the session’s actual one on the XNYS calendar
(XnysSessionCalendar): 16:00, and 13:00 on an early close.
An article’s tickers are its tickers and the tickers of its
insights; each is placed on the permaticker the Ticker map gives it on
the article’s trading day, through
quantlab.dataset.massive.placement.TickerPlacement, and the article
counts once for each permaticker placed (two tickers placed on one
security count once). A ticker the map cannot place is left out and
counted in <store>.unplaced.json. Only the universe’s permatickers (by
default SEP’s domestic common stock) are columns.
The store is built through the last day SEP, the news pull and the Ticker
map all reach, so update() appends a day only once each of them holds
it. The pull’s watermark is a day in UTC; every article counting on a
trading day was published by its close in New York that day, before the UTC
day ends, so a watermark through the day holds them all.
Examples#
Build the store and read a security’s daily counts:
config = MassiveNewsConfig(
zarr_file_path="/data/quantlab/market/massive/massive_news_1d/massive_news_1d.zarr",
raw_data_dir_path="/data/quantlab/downloads/sharadar",
massive_dir="/data/quantlab/downloads/massive",
ticker_map_path="/data/quantlab/market/massive/massive_ticker_map/massive_ticker_map",
start_date="2016-10-10",
)
panel = MassiveNewsDataset(config).update().panel("2024-01-02", "2024-12-31")
panel["news_count"].sel(symbol=199059)
Classes
Daily panel of Massive's news counts and sentiment labels, by permaticker. |