Checking Historical Market Data Coverage with a Trading Calendar and Heatmap
Summary
This tutorial presents a visual method for checking historical market data coverage. It retrieves end-of-day equity prices from a vendor, converts the response into tabular data, and aligns each security’s observations to a complete exchange trading calendar. A masked table plotted as a heatmap then exposes missing prices as blank cells. The example examines adjusted closing prices for ten large US stocks over a historical period, including securities that began trading after the start date, so expected gaps can be distinguished from accidental omissions.
The method stresses that a valid trading calendar matters: generic holiday calendars can include days when exchanges are open or omit exchange holidays. The tutorial discusses exchange calendars, date and time zone handling, and labeling the heatmap to make coverage easier to inspect. It demonstrates the approach on one vendor’s daily data and a small set of equities; adapting it to other providers, fields, or date ranges requires changing the data retrieval step. The visualization reveals coverage patterns quickly, but it is a diagnostic for missing observations rather than a full assessment of price accuracy or broader data quality.
Key ideas
- Align vendor observations to a complete exchange trading calendar to reveal missing sessions.
- Plot a masked price table as a heatmap so absent observations appear as blank cells.
- Use instrument listing dates to distinguish expected gaps from data delivery problems.
- Exchange calendars differ from generic holiday calendars, so calendar choice affects coverage checks.
- A coverage heatmap identifies missing values but does not establish that reported prices are accurate.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.