Files
Michael Handschuh b1b8da1e17 Fixes Market Simulated Automatic Option Assignment (#4853)
* Add underlying holdings to regression result handler details log

When debugging option exercise/assignment issues it's useful to see the
underlying holdings at the time the option contract fill event is processed.

Also adds the full symbol string to the top of the order event section.
The Symbol.Value was being logged via OrderEvent.ToString(), but it wasn't
the full SecurityIdentifier - by including the full SID string it makes it
easier to correlate fills over symbol rename boundaries.

* Fix automatic option assignment from market simulation

During the recent OptionExerciseOrder.Quantity refactor, this case was missed.
Additionally, it was realized that there were no regression tests covering the
automatic assignment via the market conditions simulation. This change introduces
a regression algorithm that covers the automatic assignment of put/call options.

* Update BasicOptionAssignmentSimulation._rand to be non-static

If this value is static then we reuse the same Random instance for ALL regression
tests, thereby defeating the purpose of using a well known seed number. This means
we get different results based on the order execution of preceding algorithms.
By making this an instance variable each algorithm will start with the same seed
value, ensuring consistent runs between regression tests, either run as a suite or
running a single algorithm in isolation.
2020-10-13 19:39:25 -03:00
..

alt tag

LEAN Data Formats / Options

QuantConnect hosts options data provided by AlgoSeek. The data contains quotes, trades, and open interest data. You can explore options data on our website at https://www.quantconnect.com/data/tree/option/

The data are stored as compressed ZIP files, each containing multiple CSV entries, varying on the option style, e.g. call/put, strike price, and expiration date.

Options data can be used with the following Resolutions:

  • Minute

The markets we currently support are:

  • USA

tickType in this documentation can refer to one of the following:

  • trade
  • quote
  • openinterest

Minute File Format

Minute files are located in the option / market / resolution / symbol folder.

The zip files have the filename format: YYYYMMDD_tickType_optionType.zip. The CSV file contained within has the filename format: YYYYMMDD_symbol_resolution_tickType_optionType_optionStyle_decicentStrikePrice_symbolExpirationDate(YYYYMMDD).csv

Minute trade schema and example data is as follows:

Time Open High Low Close Volume
63271000 120800 125600 120800 125000 404
  • Time - Milliseconds since midnight
  • Open - Opening price as deci-cents
  • High - High price as deci-cents
  • Low - Low price as deci-cents
  • Close - Closing price as deci-cents
  • Volume - Total contracts traded

Minute quote schema and example data is as follows:

Time Bid Open Bid High Bid Low Bid Close Last Bid Size Ask Open Ask High Ask Low Ask Close Last Ask Size
10920000 120800 125600 120800 125000 10 120900 126800 120900 137000 100
  • Time - Milliseconds since midnight
  • Bid Open - Opening price for the best bid as deci-cents
  • Bid High - Highest recorded bid price as deci-cents
  • Bid Low - Lowest recorded bid price as deci-cents
  • Bid Close - Closing price for the best bid as deci-cents
  • Last Bid Size - Size of best bid at close
  • Ask Open - Opening price for the best ask as deci-cents
  • Ask High - Highest recorded ask price as deci-cents
  • Ask Low - Lowest recorded ask price as deci-cents
  • Ask Close - Closing price for the best ask as deci-cents
  • Last Ask Size - Size of best ask at close

Divide prices by 10,000 to convert deci-cents to dollars

Minute open interest schema and example data is as follows:

Time Open Interest
50280000 102
  • Time - Milliseconds since midnight
  • Open Interest - outstanding contracts