Skip to content

Fix _covered_call deep ITM delta default and remove OTM% selection path#181

Closed
Copilot wants to merge 1 commit intoclaude/per-leg-delta-targetingfrom
copilot/sub-pr-179
Closed

Fix _covered_call deep ITM delta default and remove OTM% selection path#181
Copilot wants to merge 1 commit intoclaude/per-leg-delta-targetingfrom
copilot/sub-pr-179

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 25, 2026

_covered_call defaulted leg1_delta to ATM (~0.50), contradicting the docstring describing it as a synthetic long stock position. Multi-leg helpers (_spread, _butterfly) also used symmetric deltas, causing legs to collapse onto the same strikes. Separately, the OTM% and delta-targeting code paths had significant duplication across core.py and evaluation.py.

Changes

  • Delta defaults corrected (_helpers.py)

    • _covered_call: leg1_deltaDEEP_ITM (target=0.80, range [0.60, 0.95]) to properly simulate synthetic long stock
    • _spread: leg1 → ATM (0.50), leg2 → OTM (0.10) so legs select distinct strikes
    • _butterfly: leg1 → ITM wing (0.40), leg2 → ATM (0.50), leg3 → OTM wing (0.10)
    • New named constants: _DEFAULT_DEEP_ITM_DELTA, _DEFAULT_ITM_WING_DELTA, _DEFAULT_OTM_WING_DELTA
  • OTM% path removed (core.py, evaluation.py, filters.py, types.py)

    • Delta targeting is now the sole entry-selection mode; max_otm_pct, otm_pct_interval, delta_min, delta_max params dropped
    • Aggregated output groups by delta_range (was otm_pct_range)
    • delta column is now required in input data
  • Duplication consolidated

    • _match_entries_exits() extracted as shared helper in evaluation.py
    • _merge_legs() extracted in core.py, shared between _strategy_engine() and _process_strategy_delta_targeted()
  • Docstrings updated (covered_call, protective_put) to reflect delta-based defaults and note the synthetic-only limitation

# Before: leg1 defaulted to ATM, same delta as leg2 → legs could land on same strike
kwargs.setdefault("leg1_delta", _DEFAULT_ATM_DELTA)   # target=0.50
kwargs.setdefault("leg2_delta", _DEFAULT_DELTA)        # target=0.30

# After: leg1 explicitly deep ITM to simulate synthetic underlying
kwargs.setdefault("leg1_delta", _DEFAULT_DEEP_ITM_DELTA)  # target=0.80, range [0.60, 0.95]
kwargs.setdefault("leg2_delta", _DEFAULT_DELTA)            # target=0.30, range [0.20, 0.40]

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] WIP Address feedback on covered call function implementation Fix _covered_call deep ITM delta default and remove OTM% selection path Feb 25, 2026
@michaelchu michaelchu closed this Feb 25, 2026
@michaelchu michaelchu deleted the copilot/sub-pr-179 branch February 25, 2026 23:51
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.

2 participants