-
-
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
Futures and Future Options file-based universes #8480
Open
jhonabreul
wants to merge
49
commits into
QuantConnect:master
Choose a base branch
from
jhonabreul:feature-fops-universe-files
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Futures and Future Options file-based universes #8480
jhonabreul
wants to merge
49
commits into
QuantConnect:master
from
jhonabreul:feature-fops-universe-files
+4,876
−3,112
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
Also refactor future chain provider to use the new FutureUniverse instead of zip file names
Also, remove IDerivativeSecurity interface from Future
Modified algorithms to use futures contract objects directly instead of accessing their Symbol property. Removed unnecessary import statements and redundant lines in various files.
- Added `AddData` method to `BaseChain` for adding market data - Refactored `TimeSliceFactory` to use `BaseChain.AddData` method
Removed public indexers in `BaseChains` for getting or setting `BaseChain` instances by `ticker` or `Symbol`, which were used for Pythonnet compatibility.
Renamed `FileBasedUniverse` to `BaseChainUniverseData` and `IFileBasedUniverse` to `IChainUniverseData`.
- Introduced `BaseContract` as an abstract base class for contracts, consolidating common properties and methods. - Removed ISymbolInterface
Removed ZipEntryName class and references across various files. Removed DataQueueFuturesChainUniverseDataCollectionEnumerator and DataQueueOptionChainUniverseDataCollectionEnumerator classes. Removed OptionChainUniverseSubscriptionEnumeratorFactory class. Removed unused code for handling OptionChainUniverse and FuturesChainUniverse in FileSystemDataFeed.cs and LiveTradingDataFeed.cs. Removed several test files related to enumerator factories and universe data collection.
Forward price data from bars and ticks stored in private fields for improved memory usage
Added HSI futures universe files
Internals go first
Future options IV, Open interest and greeks are not supported for future options
jhonabreul
force-pushed
the
feature-fops-universe-files
branch
from
January 17, 2025 21:19
aba9f13
to
d00ff8e
Compare
Martin-Molinero
approved these changes
Jan 20, 2025
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.
Nice work! 🚀
Removed greeks and IV columns. Updated FOPs universe files: removed outdated columns.
Martin-Molinero
approved these changes
Jan 21, 2025
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
FutureUniverse
type to handle Futures selection.QCAlgorithm.FuturesChain
andQCAlgorithm.FuturesChains
API following AddQCAlgorithm.OptionChain()
method to fetch option chains #8316,QCAlgorithm
'sOptionChain()
api refactor #8334, and Universe data frames normalization #8385Algorithms with changed stats:
The way now futures and fops selection happens just changed the times at which orders are being placed.
Also, data points count is reduced the same way as with #8212 and history data points is increased in some algorithms due to history requests being made for getting futures and future options chains.
GC map file added data:
Needed for
FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm
since there was no mapping data for the algorithm's date range. Now it is needed in order for theSubscriptionDataReader
to be able to get a tradable date and readFutureUniverse
files.Benchmarks
Single Future, selecting all contracts and adding options for each contract:
This benchmark tests selection only, since options are loaded but not selected, so no market data is loaded for options:
The algorithm only runs for 6 months and is stopped using
Quit()
Master: ~21s (on average)
Branch: ~2.15s
This next benchmark is the same as the one above, but uses 6 futures instead on a single one. The algorithm only runs for 2 months and is stopped using
Quit()
Master: ~44.2s
Branch: ~3.16s
Related Issue
Closes #6861
Closes #4821
Closes #8370
Motivation and Context
Requires Documentation Change
How Has This Been Tested?
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>