-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File-based options universe #8212
Merged
Martin-Molinero
merged 83 commits into
QuantConnect:master
from
jhonabreul:feature-options-greeks-data
Sep 9, 2024
Merged
File-based options universe #8212
Martin-Molinero
merged 83 commits into
QuantConnect:master
from
jhonabreul:feature-options-greeks-data
Sep 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Nice work, leaving a few minor comments 👍
Algorithm.CSharp/CoarseFineOptionUniverseChainRegressionAlgorithm.cs
Outdated
Show resolved
Hide resolved
Algorithm.Python/OptionUniverseFilterOptionsDataRegressionAlgorithm.py
Outdated
Show resolved
Hide resolved
cfdcb22
to
ad0bd54
Compare
166aac0
to
9371f6a
Compare
f46ef9f
to
3f716ba
Compare
201aa70
to
c863347
Compare
- Adjust OptionUniverse start-end times and period. - Adapt unit tests and some algorithms to pass with new options universe selection.
b78d2b4
to
3327576
Compare
This was referenced Sep 10, 2024
wtindall1
pushed a commit
to wtindall1/Lean
that referenced
this pull request
Nov 10, 2024
* Initial options universe with greeks implementation * Options universe improvements * Address peer review * File based options universe fixes and improvements. - Adjust OptionUniverse start-end times and period. - Adapt unit tests and some algorithms to pass with new options universe selection. * Updated options regression algorithms stats for new universe data * Updated options regression algorithms stats for new universe data * Updated options regression algorithms stats for new universe data * Updated options regression algorithms stats for new universe data * Updated options regression algorithms stats for new universe data * Option chain provider with new options universe * Allow canonical option history requests * Address peer review * Address peer review * Fix symbols parsing in OptionUniverse * Fix universe selection subscriptions start time to not include extended market hours * Minor changes * Minor changes * Peer recommended changes and fixes * Update regression algorithm stats * Update regression algorithms stats and minor fixes * Fix option chain provider history request * Round option indicators values * Added option universe csv header property * Update regression algorithms stats * Update regression algorithms stats * Data fixes and regression algos stats update * Unit test fixes * Minor changes * Option chain handling in live trading data feed * Minor changes * Added processed data provider * Fix thread-safety violation in Slice class * Minor change * Update options filter universe API to use OptionUniverse data Add new filter methods for greeks, IV and open interest * Option filter universe api updates * Add OptionUniverse history regression algorithms * Add regression algorithms for new options filter universe api methods * Added options greeks data and updated regression algorithms * Address peer review * Address peer review * Add more assertions to new options filter api regression algorithms * Minor performance improvement. Reduce greeks binomial model steps to 140 * Minor tests updates * Greeks numerical models performance improvements * Greeks numerical models performance improvements * Revert array pool change for option pricing numerical models * Update default dividend yield provider depending on option type * [TEST] * Add helper method con calculate time till expiration * Use double in price option numerical models * Implied volatility calculation improvements - Adjust root finding method accuracy as a factor of the option price - Use BSM to get a first guess * Cleanup * Some regression algorithms and unit tests cleanup * Regression tests updates after rebasing from master * Add universe files * Self review and cleanup * Minor regression tests updates after rebase * Fix: set data time zone to same as exchange tz for options universes * Minor change * Minor change * Fix for live trading options universe selection * Keep underlying when aggregating collections in BaseDataCollectionAggregatorEnumerator * Update index options regression algorithms stats * Minor change * Address peer review * Memory usage improvements * Minor build fix * Minor changes and test fixes * Cache symbols in OptionUniverse * Cleanup * Fix index option creation in OptionUniverse * Use cached underlying SID when parsing from string * Abstract symbols cache to BaseDataCollection * Return actual underlying symbol when mapping decomposing ICO ticker * Address peer review * Minor performance improvements reduce garbage * Limit Symbols and SIDs cache size to help with memory usage * Minor fix in symbols and sid cache cleanup * Build fix * Lazily parse greeks on individual access * Cleanup and tests * Address peer review * Minor greeks fix --------- Co-authored-by: Martin Molinero <[email protected]>
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Refactor Equity and Index Option universe selection:
Notes about some algorithms with changed stats:
BasicTemplateSPXWeeklyIndexOptionsAlgorithm
:Sample()
calls is made on 2021/1/9 midnightIndexOptionScaledStrikeRegressionAlgorithm
:BasicTemplateOptionsFrameworkAlgorithm
:Related Issue
Part of #6861
Motivation and Context
Requires Documentation Change
New filters should be documented
How Has This Been Tested?
Backtesting benchmarks
1. Basic speed test:
Algorithm with a span of 4 years adding SPX options with minute resolution:
Case 1: Selecting 0 contracts in the filter function
This case allows us to test the chain loading and selection speed, without price data.
Case 2: Selecting up to 10 contracts each date
Not that big of a difference once contracts are selected, but pure contracts loading is much faster.
2. Filtering speed test:
SPY options algorithm of 6 month with daily resolution, doing some work in the filter function to get implied volatility values for filtering:
ImpliedVolatility
indicator and using the resulting IV values to do filtering.OptionUniverse
instances.Case 1: Selecting all contracts with IV in [50% IV Median, 150% IV Median]
A time reduction of about 30%.
Case 2: Doing the IV calculations, but selecting 0 contracts.
This case allows us to test speed difference for option contracts loading and filtering only, without price data fetching and loading taken into consideration.
Selection based on greeks is now dramatically faster and simpler.
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>