Repository navigation
Conversation
Author
|
I already signed the CLA. Got a message asking me to sign. This update fixes an error that can cost an inexperienced trader serious money. |
Author
|
Synced with develop at 571099c. All 115 options tests passed, including the expiration-selection regressions. Could a maintainer approve the fork workflows and review the fix? I would like to get this options issue fixed. |
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.
Description
The strike helper filters the chain to the requested expiration, then overwrites that selection with strikes from every expiration. That can make
strangle()pick the wrong contracts and report the wrong cost.This uses the filtered chain's strikes and keeps them sorted. In the regression fixture, a January strangle was picking the $100 call instead of the $110 call, giving a cost of $5.20 instead of $2.20 per share.
No new dependencies.
How has this been tested?
Seven new regression cases cover date and DTE selection, different strike grids, unfiltered lookups, and long and short strangles. Six fail before the fix. All 115 options tests pass after it.
From
openbb_platform/core:pytest tests/provider/utils/test_options_chains_strike_selection.py tests/provider/utils/test_options_chains_properties.py tests/provider/standard_models/test_options_chains.py -q ruff check . ruff format --check openbb_core/provider/utils/options_chains_properties.py tests/provider/utils/test_options_chains_strike_selection.py ty check openbb_core/provider/utils/options_chains_properties.pyFull core formatting and type checks have the same failures on unchanged
develop: one formatting issue in the docstring-generator tests, two type errors inmethod_definition.py, and atomliimport warning. The changed files pass.Checklist
hotfix/branch targetingdevelop.