Skip to content

Generate daily option universe files in RandomDataGenerator - #9740

Open
hsm207 wants to merge 3 commits into
QuantConnect:masterfrom
hsm207:feature-8854-option-universe-generator
Open

Generate daily option universe files in RandomDataGenerator#9740
hsm207 wants to merge 3 commits into
QuantConnect:masterfrom
hsm207:feature-8854-option-universe-generator

Conversation

@hsm207

@hsm207 hsm207 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Description

When running RandomDataGenerator with --security-type Option, LEAN previously generated option tick and pricing zip files (data/option/usa/minute/<ticker>/<date>_trade_american.zip), but omitted the daily option universe selection CSV metadata (data/option/usa/universes/<ticker>/<date>.csv). As a result, algorithms attempting to run coarse option chain universe selection against synthetic data would fail to discover option chains.

This PR introduces OptionUniverseWriter in ToolBox/RandomDataGenerator which:

  1. Aggregates intraday contract ticks into daily summary OHLCV rows for each contract.
  2. Writes standard daily option universe selection CSV files conforming to LEAN's universe data format (BaseChainUniverseData.GetUniverseFullFilePath).
  3. Formats the underlying equity reference row (,,,open,high,low,close,volume,...) and contract rows using OptionUniverse.ToCsv.
  4. Adds a null fallback to InterestRateProvider so the generator can run in standalone offline mode.

Related Issue

Closes #8854

Motivation and Context

Allows developers and quantitative researchers to generate synthetic options data locally and run universe selection backtests completely offline without requiring cloud data downloads.

Requires Documentation Change

No.

How Has This Been Tested?

  • Dedicated Unit Tests: Added OptionUniverseWriterTests (Tests/ToolBox/RandomDataGenerator/OptionUniverseWriterTests.cs) verifying deterministic universe file path generation, CSV headers, underlying equity OHLCV row formatting, and option contract row serialization.
  • Generator & Downloader Suite: Executed all 62 unit tests across RandomDataGenerator (tick generation, symbol generators, price model estimators, dividend/split map generators) and InterestRateProviderTests via dotnet test (Passed 100%, 62/62 in 7 s).
  • Compilation: Full solution rebuild across all 17 projects in QuantConnect.Lean.sln succeeded with 0 compiler warnings and 0 errors.
  • Offline Standalone Execution: Verified synthetic option universe generation runs completely offline without requiring live cloud data connections.

Types of changes

  • 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)
  • 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:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention feature-8854-option-universe-generator

hsm207 added 3 commits August 23, 2026 20:09
…nect#8854)

- Automatically generate daily option universe CSV files when generating synthetic options data

- Add standalone data provider fallback to InterestRateProvider

- Add OptionUniverseWriter unit test suite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RandomDataGenerator Doesn't Generate Auxiliary Data

1 participant