US Equity Primary Exchange Daily OHLC Guide
US Equity Primary Exchange Daily OHLC Guide
version 1.8 (Jul 2021)
We are here to help you do great things with our market and reference data. For questions, feedback, and other concerns, you may reach our team of experts using the following contact information:
algoseek customer support
support@algoseek.com
(+1) 646 583 1832
algoseek sales
sales@algoseek.com
(+1) 646 583 1832
OFFICIAL OPEN/CLOSE IDENTIFICATION 5
DATA ORGANIZATION AND FILE FORMAT 7
APPENDIX A. FREQUENTLY ASKED QUESTIONS 10
APPENDIX B. BAR CALCULATIONS FROM TRADE EVENTS 11
This guide describes the Primary Exchange Daily OHLC data available for US Equities.
The dataset is built from the Trades and Quotes of the Securities Information Processor (SIP) data, also known as the “Consolidated Feed” for all listed stocks, ETNs, ETFs, ADRs, and funds.
Each US Equity has a Primary Listing Exchange considered the official Open/Close auction cross for the Equity, even though Open/Close auction crosses may take place on other exchanges. This dataset includes each Equity’s Open/Close based on the primary exchange on that trade date. The Primary Exchange for a stock occasionally changes, for example, when ORCL moved to NYSE from NASDAQ in July 2013.
There are two data aggregation options for this dataset that provide exactly the same data fields:
tradedate: one CSV file with data for all symbols per trading day
secid: one CSV file with data for all trading days per Security ID - a unique security identifier used by algoseek that remains unchanged when the ticker changes
The opening and closing trades are defined as the Opening and Closing Trade Cross on the Primary exchange. Identifying these trades is simple in theory; in actual practice, it has only become easy in the last few years as all the Primary Exchanges began publishing an Official Open and Close. algoseek identifies the Open/Close cross based on the Trade flags published with each trade.
Please refer to Appendix B for a detailed daily bars logic.
algoseek selects the Open Trade for an equity on the Primary Exchange from the priority order of trade types in this table.
Table 1: Open Trade from Trade Type
Priority | Open Order Type | Description |
1 | Primary Official Open | The Official Open trade on the Primary Exchange |
2 | Primary Opening Print | The Opening Print trades on the Primary Exchange |
3 | Regular Opening Trade | The largest regular size trade on the Primary Exchange from market Open to (Open + 15 minutes), which is normally 09:30 to 09:45 ET |
4 | First Trade Market Hours | The first regular trade on the Primary Exchange after the (Open + 15 minutes). This only applies to stocks with very small volumes |
Since the exchanges have used different condition flags (or none at all) to identify the closing cross over the years, algoseek uses the following priority order to identify the Closing trade for a stock.
Table 2: Closing Trade for a Stock
Priority | Close Order Type | Description |
1 | Primary Official Close | The Official Close on Primary Exchange |
2 | Primary Closing Print | The sum of closing print trades on the Primary Exchange. The sum is needed as some exchanges (e.g. ARCA) used to print multiple closing prints instead of a single trade with the total size |
3 | Regular Closing Trade | The largest regular size trade on the Primary Exchange from Close to (Close + 5 minutes), which is normally 16:00 to 16:05:00 ET (except for half-days and early closes) |
4 | Last Trade before Close | The last trade on the Primary Exchange before the market Close |
The US Stock Market trading hours are split into the pre-market, market, and post-market hours.
Pre-Market Hours: 04:00:00 to 09:30:00 (excluding)
Market Hours: 09:30:00 to 16:00:00 (excluding)
Post-Market Hours: 16:00:00 to 20:00:00
Note: Occasionally, trade events are recorded several minutes after 20:00.
The “Open” normally refers to the Opening Cross at 09:30:00 ET. The “Close” normally refers to the Closing Cross at 16:00:00 ET.
The stock market is closed for trading on most US holidays. For reference, algoseek publishes a list of historical holidays, which is available at s3://us-equity-market-holidays/holidays.csv (direct download link: https://us-equity-market-holidays.s3.amazonaws.com/holidays.csv).
Markets sometimes close early at 13:00:00 on the day before holidays such as Independence Day and Thanksgiving. You can download algoseek’s early close date and time list from AWS S3 storage at s3://us-equity-market-holidays/earlycloses.csv (or use a direct link us-equity-market-holidays.s3.amazonaws.com/earlycloses.csv).
algoseek provides Equity market data in plain-text CSV files. The first row of the CSV file is a fixed header, and then rows of data corresponding to individual events (see Table 3). By default, the dataset is organized either by trading day or by secid. It means, for example, that all daily Open/Close data for Mar 3, 2020, are stored in a separate CSV file under a tradedate aggregation. For the secid-based aggregation, all data for the security with an ID 33449 (AAPL) for a single year is stored in a separate CSV file.
Table 3 below summarizes the name, description, and data type for each data field (column). The Field order below is for SecId-based aggregation. For tradedate-based data aggregation, the “TradeDate” is the first column and “SecId” is the second.
Table 3: CSV File Fields Schema
Field | Type (Format) | Description |
SecId | integer | algoseek unique Security ID |
TradeDate | string (yyyymmdd) | Trading date in yyyymmdd format |
Ticker | string | Symbol name |
Name | string | Name of equity security |
PrimaryExchange | string | Primary listing exchange on this TradeDate |
ISIN | string | ISIN as of this trade date. Optional. |
OpenPrice | decimal | Primary exchange opening trade (see section “Opening Trade Identification”) |
OpenSize | integer | Primary exchange open trade size |
OpenTime | time | Time of the Primary exchange opening trade |
HighPrice | decimal | Highest trade price from any exchange or Trade Reporting Facility (TRF) |
HighTime | time | Time of the highest trade |
LowPrice | decimal | Lowest trade price from any exchange or Trade Reporting Facility (TRF) |
LowTime | time | Time of the lowest trade |
ClosePrice | decimal | Primary exchange closing trade (see section “Closing Trade Identification”) |
CloseSize | integer | Primary exchange close trade size |
CloseTime | time | Time of the Primary exchange closing trade |
ListedMarketHoursVolume | integer | Public Listed exchanges trading volume during regular market hours only |
ListedMarketHoursTrades | integer | Number of trades during regular market hours in public listed exchanges |
ListedTotalVolume | integer | Public Listed exchanges trading volume for the whole day (includes pre, regular, and post-market) |
ListedTotalTrades | integer | Public Total number of trades for the trade date (includes pre-, regular, and post-market) in listed exchanges |
FinraMarketHoursVolume | integer | FINRA/TRF trading volume during regular market hours only (normal trade day is 09:30:00 to 16:00:00 ET). FINRA/TRF represents off-exchange trading. |
FinraMarketHoursTrades | integer | The number of FINRA/TRF trades during regular market hours. FINRA/TRF represents off-exchange trading. |
FinraTotalVolume | integer | FINRA/TRF trading volume for the whole day (includes pre-, regular, and post-market) |
FinraTotalTrades | integer | Total number of FINRA/TRF trades for the trade date (includes pre, regular, and post-market). FINRA/TRF represents off-exchange trading. |
MarketVWAP | decimal | Volume weighted average price during regular market hours, normally between 09:30:00 and 16:00:00 ET plus the Opening and Closing Cross (which may be after 16:00:00 ET). |
DailyVWAP | decimal | Volume weighted average price for the whole day including pre, regular, and post-market trades. |
MarketVWAP and DailyVWAP: Market volume weighted average price (VWAP) is calculated as
sum(TradePrice x TradeSize) / sum(TradeSize)
where
sum(TradeSize) = ListedMarketHoursVolume + FinraMarketHoursVolume
Open/High/Low/Close with Limited Trades or Single Trade
Some stocks may only have a single trade during the entire day. For example, with a single trade at 12:00:00 ET then,
Open = High = Low = Close = 12:00:00 Trade price.
FINRA/TRF vs Exchange Trades
FINRA Trade Reporting Facility (TRF) allows for reporting of trades that do not take place on an exchange, this includes Dark Pools, Broker-Dealer internal trading, Over the Counter (OTC), etc.
algoseek separates trade volume and number of trades into listed exchanges and FINRA/TRF for clients to have a more in-depth understanding of real liquidity on the exchanges.
Total volume can be calculated as
TotalVolume = ListedMarketHoursVolume + FinraMarketHoursVolume
Null values at columns OpenPrice (ClosePrice) and OpenSize (CloseSize) for low liquid symbols are caused by the absence of trades around the Open (Close) time for such tickers. At the same time, trades can appear later (earlier) in the SIP feed, that is why we only see ClosePrice (OpenPrice) and CloseSize (OpenSize).
algoseek provides official opening/closing cross price based on stock's primary exchange, event flags, time, and volume.
Most Data vendors simply use the first/last trade, or the opening/closing cross from a random exchange as opening/closing price.
This section describes the logic for daily bar calculations based on events from the Trade Only dataset. Please also refer to the Equity Trade Only Guide for more details on the data fields and condition flags used.
In this section, Market hours refer to 9:30:00 (including) - 16:00:00 (excluding) for regular trading days and to 9:30:00 (including) - 13:00:00 (excluding) when there was an early close.
The Opening Trade is selected from the following priority order list:
The Regular Open corresponds to the first event satisfying all the conditions below:
Regular First is the first event satisfying all the conditions below:
The Closing Trade is selected from the following priority order list:
The Regular Close is the last event satisfying all the condition below:
Regular Last is the last event satisfying all the conditions below:
Daily High is the first event satisfying all the conditions below:
Daily Low corresponds to the first event satisfying all the conditions below:
All events are accounted unless any of the flags from Table 4 are present. For ListedMarketHoursVolume and ListedTotalVolume columns, only events from Public Listed exchanges are accounted. For FinraMarketHoursVolume and FinraTotalVolume columns, only events from FINRA Exchange are accounted.
Table 4: Flags for Trade Events to be Excluded During Volume Calculations
Bit Mask Position | Flags |
24 | tOfficialClose |
26 | tOfficialOpen |