Data Format
US Equity
Introduction
US Equity data has trade and quote data at tick, second, and minute resolutions. The hour and daily resolutions have trade data only. LEAN stores US Equity prices multiplied by 10,000. The data time zone is America/New_York. Other Equity markets, such as india, use the same format with their own market folder and data time zone.
Folder Structure
The following table shows the paths of the US Equity data files:
| Resolution | Zip File | CSV File |
|---|---|---|
| Tick | equity / usa / tick / <ticker> / <date>_<tickType>.zip | <date>_<ticker>_Trade_Tick.csv <date>_<ticker>_Quote_Tick.csv |
| Second and minute | equity / usa / <resolution> / <ticker> / <date>_<tickType>.zip | <date>_<ticker>_<resolution>_<tickType>.csv |
| Hour and daily | equity / usa / <resolution> / <ticker>.zip | <ticker>.csv |
Each zip file contains one CSV file. For example, equity / usa / minute / aapl / 20140605_trade.zip contains 20140605_aapl_minute_trade.csv. The CSV file names of tick data capitalize the tick type and resolution.
Bar Data
The following table shows the bar data, with example rows from the AAPL minute files of June 5, 2014:
| Data Type | Resolutions | Example |
|---|---|---|
| Trade bar | Second, minute, hour, and daily | 15300000,6448000,6448000,6448000,6448000,90 |
| Quote bar | Second and minute | 14400000,6438000,6440600,6438000,6440600,100,6460000,6460000,6460000,6460000,100 |
Tick Data
US Equity tick files have trade ticks and quote ticks. The following table describes the columns of trade ticks, with an example row from equity / usa / tick / aig / 20131007_trade.zip:
| Column | Description | Example |
|---|---|---|
| Time | Milliseconds since midnight | 14400688 |
| Price | Trade price multiplied by 10,000 | 491800 |
| Quantity | Number of shares traded | 300 |
| Exchange | Exchange code, such as P for ARCA or Q for NASDAQ | P |
| Sale Condition | Hexadecimal value of the TradeConditionFlags | 2000 |
| Suspicious | 1 if the tick is suspicious and 0 otherwise | 0 |
The following table describes the columns of quote ticks, with an example row from equity / usa / tick / aig / 20131007_quote.zip:
| Column | Description | Example |
|---|---|---|
| Time | Milliseconds since midnight | 14400152 |
| Bid Price | Bid price multiplied by 10,000 | 0 |
| Bid Size | Number of shares at the bid | 0 |
| Ask Price | Ask price multiplied by 10,000 | 494100 |
| Ask Size | Number of shares at the ask | 300 |
| Exchange | Exchange code, such as P for ARCA or Q for NASDAQ | Q |
| Sale Condition | Hexadecimal value of the QuoteConditionFlags | 1 |
| Suspicious | 1 if the tick is suspicious and 0 otherwise | 0 |
Each quote tick has data for one side of the book, and the other side has a price and size of 0. The bar-building process excludes the prices of suspicious ticks and of ticks with some condition flags. For the rules, see Bar Building.
The Sale Condition column holds a bit mask of flags. For example, the trade tick value 2000 is the TradeConditionFlags.ExtendedHoursTradeConditionFlags.EXTENDED_HOURS flag. The following table describes the TradeConditionFlags of trade ticks:
TradeConditionFlags | Status | Description |
|---|---|---|
RegularREGULAR | Included | A trade made without stated conditions is deemed the regular way for settlement on the third business day following the transaction date. |
FormTFORM_T | Included | Trading in extended hours enables investors to react quickly to events that typically occur outside regular market hours, such as earnings reports. However, liquidity may be constrained during such Form T trading, resulting in wide bid-ask spreads. |
CashCASH | Included | A transaction that requires delivery of securities and payment on the same day the trade takes place. |
ExtendedHoursEXTENDED_HOURS | Included | Identifies a trade that was executed outside of regular primary market hours and is reported as an extended hours trade. |
NextDayNEXT_DAY | Included | A transaction that requires the delivery of securities on the first business day following the trade date. |
OfficialCloseOFFICIAL_CLOSE | Included | Indicates the "official" closing value determined by a Market Center. This transaction report will contain the market center generated closing price. |
OfficialOpenOFFICIAL_OPEN | Included | Indicates the 'Official' open value as determined by a Market Center. This transaction report will contain the market center generated opening price. |
ClosingPrintsCLOSING_PRINTS | Included | The transaction that constituted the trade-through was a single priced closing transaction by the Market Center. |
OpeningPrintsOPENING_PRINTS | Included | The trade that constituted the trade-through was a single priced opening transaction by the Market Center. |
IntermarketSweepINTERMARKET_SWEEP | Excluded | The transaction that constituted the trade-through was the execution of an order identified as an Intermarket Sweep Order. |
TradeThroughExemptTRADE_THROUGH_EXEMPT | Excluded | Denotes whether or not a trade is exempt (Rule 611). |
OddLotODD_LOT | Excluded | Denotes the trade is an odd lot less than a 100 shares. |
Quote bars use quotes that have at least one of the following QuoteConditionFlags:
QuoteConditionFlags | Description |
|---|---|
RegularREGULAR | This condition is used for the majority of quotes to indicate a normal trading environment. |
SlowSLOW | This condition is used to indicate that the quote is a Slow Quote on both the bid and offer sides due to a Set Slow List that includes high price securities. |
GapGAP | While in this mode, auto-execution is not eligible, the quote is then considered manual and non-firm in the bid and offer, and either or both sides can be traded through as per Regulation NMS. |
OpeningQuoteOPENING_QUOTE | This condition can be disseminated to indicate that this quote was the opening quote for a security for that Participant. |
FastTradingFAST_TRADING | For extremely active periods of short duration. While in this mode, the UTP Participant will enter quotations on a best efforts basis. |
Quote bars exclude quotes that have any of the following QuoteConditionFlags:
QuoteConditionFlags | Description |
|---|---|
ClosingCLOSING | Indicates that this quote was the last quote for a security for that Participant. |
NewsDisseminationNEWS_DISSEMINATION | Denotes a regulatory trading halt when relevant news influencing the security is being disseminated. Trading is suspended until the primary market determines that an adequate publication or disclosure of information has occurred. |
NewsPendingNEWS_PENDING | Denotes a regulatory Trading Halt due to an expected news announcement, which may influence the security. An Opening Delay or Trading Halt may be continued once the news has been disseminated. |
TradingRangeIndicationTRADING_RANGE_INDICATION | Denotes the probable trading range (Bid and Offer prices, no sizes) of a security that is not Opening Delayed or Trading Halted. The Trading Range Indication is used prior to or after the opening of a security. |
OrderImbalanceORDER_IMBALANCE | Denotes a non-regulatory halt condition where there is a significant imbalance of buy or sell orders. |
ResumeRESUME | Indicates that trading for a Participant is no longer suspended in a security that had been Opening Delayed or Trading Halted. |
For more information about the exchange codes and condition flags, see the AlgoSeek whitepaper.