Skip to content

fix(core): options strategies pass over an expiration with strikes on one side of the price - #7859

Open
artcashin wants to merge 1 commit into
openbq-org:developfrom
artcashin:fix/straddle-one-sided
Open

artcashin wants to merge 1 commit into
openbq-org:developfrom
artcashin:fix/straddle-one-sided

Conversation

@artcashin

Copy link
Copy Markdown
Contributor

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: None

By 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 check and ruff format --check clean on the touched files.

Related: #7846 handles the same listing in Cboe's term structure.

🤖 Generated with Claude Code

… 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

No deployments
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.

1 participant