* Add 2026 HKFE Future holidays & early closes * rebase Add 2026 Future-cme-equity Holidays, Early closes, late opens * Add (again) HKFE 2026 Holidays and early closes * Add Future-cme-interest 2026 holidays * Add 2026 CME Fx 2026 holidays" - Add 2026 CME Fx holidays, early closes, late opens, bank holidays - Exclude CNH, MNH and MIR as they expire rules don't consider US Holidays - Fix wrong early close on 12/24/2025 from 12:15 to 12:45 * Add CME Future crypto 2026 Holidays, EC, LO & BH * Add CME Future Energy 2026 holidays, EC, LO, BH * Add CME Futures metals holidays, ec, lo, bh * Add CME Futures grains 2026 holidays, ec, lo, bh * Add CME Futures Dairy 2026 holidays, ec, lo, bh * Add CME Futures livestock holidays, ec, lo, bh * Add CME Future Lumber holidays, ec, lo, bh * Add CME Futures Softs holidays, ec, lo, bh * Add CME Futures Oilseeds holidays, ec, lo, bh * Add CME Futures AW, GD Holidays, EC, LO and BH * Move repeated bank holidays to generic entries * Nit change * Solve bug Since 11/26/2026 is a bank holiday for CME energy futures, the expiry date is moved to 11/25/2026 as the expiry date for HH is the third last business day of the month prior to the contract month
LEAN Data Formats
Introduction
From the beginning, LEAN has strived to use an open, human-readable data format - independent of any specific database or file format. From this core philosophy, we built LEAN to read its financial data from flat files on disk. Data compression is done in zip format, and all individual files are CSV or JSON.
When there is no activity for a security, the price is omitted from the file. Only new ticks and price changes are recorded.
File Data Format
Although we strive to make all data formats identical, it is often impossible. Below are links to dedicated documentation on the file format of the data in each asset type:
Equity | Forex | Options | Futures | Crypto
Folder Structure
Data files are separated and nested in a few predictable layers:
-
Tick, Second and Minute Financial Data:
/data/securityType/marketName/resolution/ticker/date_tradeType.zip -
Hour, Daily Financial Data:
/data/securityType/marketName/resolution/ticker.zip
The marketName value is used to separate different tradable assets with the same ticker. E.g. EURUSD is traded on multiple brokerages all with slightly different prices.
Core Data Types
LEAN has a few core data types represented in all the asset classes we support. Below are links to their implementation in LEAN.
-
TradeBar - TradeBar represents trade ticks of assets consolidated for a period. TradeBar file format is slightly different for high resolution (second, minute) and low resolution (daily, hour).
-
QuoteBar - QuoteBar represents top of book quote data consolidated over a period of time (bid and ask bar).
-
Tick - Tick data represents an individual record of trades ("trade ticks") or quote updates ("quote tick") for an asset. Tick data is instantaneous - it does not have a period.
Data Readers
All data is parsed from disk via Reader() methods. The Reader takes a single line of the file and converts it the appropriate type. i.e. TradeBar.Reader() method is a factory which returns TradeBar objects. When implementing custom data, Readers are used
Other Data Formats
Theoretically LEAN can accept data in any format (database, API or flatfile). However, in practice, we currently have reader implementations written for a flat file system.
