Repository navigation
Conversation
… one side of the price When the nearest expiration lists strikes only above (or only below) the underlying price, a two-sided strategy has no out-of-the-money leg there and fails with "No premium data found for the selected strikes". Choose the next nearest expiration whose strikes span the price. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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.
What
A strategy that picks its expiration by days to expiry fails when the nearest expiration lists strikes on one side of the underlying price only.
Seen on 2026-11-17 with Cboe: SPY's 2026-12-02 expiry listed a single strike, 825, above the price.
straddle()chose that expiration as nearest to its target, found no out-of-the-money put, and raised:No premium data found for the selected strikes. Call: 825.0, Put: NoneBy the next day the expiry listed 31 strikes and the call worked again, so the fault comes and goes with how the exchange lists a new expiry.
Change
OptionsChainsProperties._get_nearest_expiration, in the days-to-expiry branch, passes over an expiration whose strikes do not span the underlying price and takes the next nearest. If no expiration spans it, the choice is unchanged. This is the one place every strategy (straddle, strangle, vertical spreads, synthetics) gets its expiration, so it is not patched per strategy.Asking for an expiration by date is unchanged.
Tests
test_options_chains_properties.py: new case with a one-strike nearest expiration and a full next one; the straddle uses the next.tests/provider: 829 pass, 13 skipped.ruff checkandruff format --checkclean on the touched files.Related: #7846 handles the same listing in Cboe's term structure.
🤖 Generated with Claude Code