Warn once for coarse option underlying resolution - #9759
Open
pengpengyi92 wants to merge 2 commits into
Open
Conversation
11 tasks
This file contains hidden or 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
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
Replaces the fatal validation from #9751 with a one-time warning, as requested in the maintainer review.
When an option contract uses a finer resolution than the finest existing underlying subscription,
AddOptionContractnow:Debugwarning once per algorithm;The validation still uses the finest available underlying subscription and
UniverseSettings.Resolutionwhen the option resolution is omitted.Related Issue
Closes #9732.
Supersedes #9751 after GitHub rejected reopening the closed pull request.
Motivation and Context
LEAN computes option implied volatility and Greeks from the underlying's latest price. A finer option subscription can therefore use a stale underlying price. A warning surfaces that risk without blocking users for whom a coarser underlying resolution is the best available data.
Requires Documentation Change
No. The warning explains the resolution relationship and recommended action.
How Has This Been Tested?
Tests/QuantConnect.Tests.csprojin Release mode with .NET 10: 0 errors.AlgorithmAddDataTests.AddOptionContract: 9 passed, 0 failed.AlgorithmAddDataTestsfixture: 54 passed; the only two failures were existing Python/Pandas tests because the minimal container does not include pandas, and neither test exercises this change.git diff --checksuccessfully.Types of changes
Checklist