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:

ResolutionZip FileCSV File
Tickequity / usa / tick / <ticker> / <date>_<tickType>.zip<date>_<ticker>_Trade_Tick.csv
<date>_<ticker>_Quote_Tick.csv
Second and minuteequity / usa / <resolution> / <ticker> / <date>_<tickType>.zip<date>_<ticker>_<resolution>_<tickType>.csv
Hour and dailyequity / 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 TypeResolutionsExample
Trade barSecond, minute, hour, and daily15300000,6448000,6448000,6448000,6448000,90
Quote barSecond and minute14400000,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:

ColumnDescriptionExample
TimeMilliseconds since midnight14400688
PriceTrade price multiplied by 10,000491800
QuantityNumber of shares traded300
ExchangeExchange code, such as P for ARCA or Q for NASDAQP
Sale ConditionHexadecimal value of the TradeConditionFlags2000
Suspicious1 if the tick is suspicious and 0 otherwise0

The following table describes the columns of quote ticks, with an example row from equity / usa / tick / aig / 20131007_quote.zip:

ColumnDescriptionExample
TimeMilliseconds since midnight14400152
Bid PriceBid price multiplied by 10,0000
Bid SizeNumber of shares at the bid0
Ask PriceAsk price multiplied by 10,000494100
Ask SizeNumber of shares at the ask300
ExchangeExchange code, such as P for ARCA or Q for NASDAQQ
Sale ConditionHexadecimal value of the QuoteConditionFlags1
Suspicious1 if the tick is suspicious and 0 otherwise0

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:

TradeConditionFlagsStatusDescription
RegularREGULARIncludedA trade made without stated conditions is deemed the regular way for settlement on the third business day following the transaction date.
FormTFORM_TIncludedTrading 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.
CashCASHIncludedA transaction that requires delivery of securities and payment on the same day the trade takes place.
ExtendedHoursEXTENDED_HOURSIncludedIdentifies a trade that was executed outside of regular primary market hours and is reported as an extended hours trade.
NextDayNEXT_DAYIncludedA transaction that requires the delivery of securities on the first business day following the trade date.
OfficialCloseOFFICIAL_CLOSEIncludedIndicates the "official" closing value determined by a Market Center. This transaction report will contain the market center generated closing price.
OfficialOpenOFFICIAL_OPENIncludedIndicates the 'Official' open value as determined by a Market Center. This transaction report will contain the market center generated opening price.
ClosingPrintsCLOSING_PRINTSIncludedThe transaction that constituted the trade-through was a single priced closing transaction by the Market Center.
OpeningPrintsOPENING_PRINTSIncludedThe trade that constituted the trade-through was a single priced opening transaction by the Market Center.
IntermarketSweepINTERMARKET_SWEEPExcludedThe transaction that constituted the trade-through was the execution of an order identified as an Intermarket Sweep Order.
TradeThroughExemptTRADE_THROUGH_EXEMPTExcludedDenotes whether or not a trade is exempt (Rule 611).
OddLotODD_LOTExcludedDenotes the trade is an odd lot less than a 100 shares.

Quote bars use quotes that have at least one of the following QuoteConditionFlags:

QuoteConditionFlagsDescription
RegularREGULARThis condition is used for the majority of quotes to indicate a normal trading environment.
SlowSLOWThis 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.
GapGAPWhile 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_QUOTEThis condition can be disseminated to indicate that this quote was the opening quote for a security for that Participant.
FastTradingFAST_TRADINGFor 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:

QuoteConditionFlagsDescription
ClosingCLOSINGIndicates that this quote was the last quote for a security for that Participant.
NewsDisseminationNEWS_DISSEMINATIONDenotes 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_PENDINGDenotes 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_INDICATIONDenotes 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_IMBALANCEDenotes a non-regulatory halt condition where there is a significant imbalance of buy or sell orders.
ResumeRESUMEIndicates 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.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: