Option strategy matcher can prefer a wide credit call spread over a cheaper naked call

未关闭
#10,072 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
54/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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). TotalMarginUsed is 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 master branch
  • I have confirmed that this is not a duplicate issue by searching issues
主要语言
C#
星标
22.6k
派生
5.4k
平均合并
11 小时 39 分钟
30 天内合并 PR
104

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

QuantConnect/Lean 的其他 Issue

查看 QuantConnect/Lean 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。