Option strategy matcher can prefer a wide credit call spread over a cheaper naked call
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- backend, fintech-quant
Research direction
Read UncoveredShortQuantityOptionStrategyMatchObjectiveFunction and the call-side width check, then compare its strike-based proxy with OptionMarginModel's naked-call margin floor. Reproduce the SPY example from the issue and check whether the matcher selects a grouping with lower TotalMarginUsed; the issue does not name a test file, so locate the relevant matcher tests. Done when the call grouping reflects the lower maintenance margin without regressing put matching.
Written by the indexing model from the issue text.
Description
Expected Behavior
When OptionStrategyMatcher has to choose between covering a short call with a wide credit-side long and leaving that short naked, it should prefer the grouping that requires less maintenance margin.
Actual Behavior
UncoveredShortQuantityOptionStrategyMatchObjectiveFunction counts a credit-side long as covering a short when the strike width is at most MaximumCreditCoverWidthFactor (10%) of the short strike. The matcher has no prices, so the strike stands in for the naked-margin floor. For puts, this matches OptionMarginModel's floor. For calls, OptionMarginModel's floor is 10% of the underlying price. For out-of-the-money calls the underlying is below the strike, so the score treats wide call spreads as covered even when they cost more than the naked call.
Reproduction (standard margin models, SPY at 100, multiplier 100, all calls expiring 2025-02-21):
| Strike | Quantity | Price |
|---|---|---|
| 140 | +1 | 0.30 |
| 150 | -1 | 0.15 |
| 151 | -1 | 0.10 |
| 164 | +1 | 0.02 |
- Current grouping: Bull Call Spread (+C140/-C150, margin 0) plus Bear Call Spread (-C151/+C164, margin 1,400).
TotalMarginUsedis 1,400. - Greedy grouping, which the second candidate replaces because it scores -1 instead of 0: Bull Call Ladder (+C140/-C150/-C151) plus a lone long C164. The ladder is margined as the naked C151, about 1,010.
The 14-point width is under 10% of the 151 strike (15.1), but over the naked-call floor of 10% of the underlying (10).
Potential Solution
A suggestion, not a requirement: compare actual maintenance margin, or use the underlying price for the call-side width check. #10062 (for #10035) gates only the new third matching candidate on actual maintenance margin. The first two candidates still rely on the strike-based proxy alone.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- Dominant language
- C#
- Stars
- 22.6k
- Forks
- 5.4k
- Avg merge
- 11h 39m
- Merged PRs (30d)
- 104
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantConnect/Lean
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/Lean#10216 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10206 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
QuantConnect/Lean#10199 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QuantConnect/Lean#10198 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10197 ·
Maintainers usually reply within 1 day
All issues in QuantConnect/Lean
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainers usually reply within 1 day
-
triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno#26676 ·
Maintainers usually reply within 1 day
-
.NET bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jhaizhou-ops/S2Arm#2177 · 3 comments ·
Maintainers usually reply within 1 day
-
area-CodeGen-coreclr untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotnet/runtime#138181 · 1 comment ·
Maintainers usually reply within 1 day