Files
Ricardo Andrés Marino Rojas 0e81589efa Bug add future option ozn (#7791)
* Models OZN: 10-Year US Treasury Future Options

<!--- Provide a general summary of your changes in the Title above -->

#### Description
We added future option for OZN

#### Related Issue
Close #7783
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

#### Motivation and Context
 We added future option supported by CME
https://www.cmegroup.com/markets/interest-rates/us-treasury/10-year-us-treasury-note.contractSpecs.options.html#optionProductId=317

#### Requires Documentation Change
No

#### How Has This Been Tested?
I tested the change using fake files to check if mapping is correct.

#### Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Refactor (non-breaking change which improves implementation)
- [ ] Performance (non-breaking change which improves performance. Please add associated performance test and results)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Non-functional change (xml comments/documentation/etc)

#### Checklist:
<!--- The following is a checklist of items that MUST be completed before a PR is accepted -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [X] My code follows the code style of this project.
- [X] I have read the **CONTRIBUTING** [document](https://github.com/QuantConnect/Lean/blob/master/CONTRIBUTING.md).
- [X] I have added tests to cover my changes. <!--- If not applicable, please explain why -->
- [X] All new and existing tests passed.
- [X] My branch follows the naming convention `bug-<issue#>-<description>` or `feature-<issue#>-<description>`

<!--- Template inspired by https://www.talater.com/open-source-templates/#/page/99 -->

* Add unit tests

---------

Co-authored-by: Ashutosh <ashutoshrana171@gmail.com>
2024-02-16 19:13:04 -03:00
..
2019-03-14 12:13:14 +01:00
2024-01-05 16:57:19 -03:00
2023-10-25 15:47:42 -03:00

alt tag

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.