Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new options strategy (Ladder) to the strategies module, expands strategy documentation in markdown, and removes redundant class docstrings in favor of description = load_description(...).
Changes:
- Added
Ladderstrategy implementation, documentation, exports, and tests. - Removed class docstrings from several existing strategies (keeping markdown descriptions as the source of truth).
- Expanded/clarified markdown documentation for
ButterflyandStrangle.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| quantflow/options/strategies/strangle.py | Removes in-code class docstring (markdown description remains). |
| quantflow/options/strategies/straddle.py | Removes in-code class docstring (markdown description remains). |
| quantflow/options/strategies/spread.py | Removes in-code class docstring (markdown description remains). |
| quantflow/options/strategies/calendar_spread.py | Removes in-code class docstring (markdown description remains). |
| quantflow/options/strategies/butterfly.py | Removes in-code class docstring (markdown description remains). |
| quantflow/options/strategies/ladder.py | Introduces the new Ladder strategy factory methods and construction logic. |
| quantflow/options/strategies/init.py | Exports Ladder from the strategies package. |
| quantflow/options/docs/strangle.md | Clarifies delta discussion for strangles. |
| quantflow/options/docs/ladder.md | Adds ladder strategy documentation. |
| quantflow/options/docs/butterfly.md | Expands butterfly documentation (balanced vs broken-wing behavior, etc.). |
| quantflow_tests/test_strategies.py | Adds ladder tests and imports. |
Suppressed comments (2)
quantflow_tests/test_strategies.py:133
- This test asserts a long put ladder is short gamma at FORWARD=100, but gamma can be positive near the bought strike (here K_high=100 is ATM). This makes the test sensitive to the pricing model and strike selection.
Prefer checking a construction invariant (net short one option) rather than gamma sign at a single point.
assert ladder.price(pricer, FORWARD, REF_DATE).gamma < 0
quantflow_tests/test_strategies.py:142
- The one-by-two ladder is net short one option, but the test currently asserts gamma < 0 at a single forward level. Gamma sign here is not guaranteed and can be model/parameter dependent.
Prefer asserting the net position size implied by the legs.
assert ladder.price(pricer, FORWARD, REF_DATE).gamma < 0
Comment on lines
+122
to
+123
| # net short one option: short gamma when long the ladder | ||
| assert ladder.price(pricer, FORWARD, REF_DATE).gamma < 0 |
| strike closest to the money and two sold further out of the money. It is sometimes called a | ||
| Christmas tree. | ||
|
|
||
| The position is net short one option, so a long ladder is short volatility and short gamma. |
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.
No description provided.