QuantConnect / QuantConnect/Lean

Extend `OptionStrategy` with additional functionality

Open
#6,661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

depth feature
Dominant language
C#
Stars
21.7k
Forks
5.3k
Avg merge
2d 22h
Merged PRs (30d)
34

Description

Motivation and Context

Currently the functionality of OptionStrategy is very limited.
If I'm not mistaken, all we can do is Buy(optionStrategy, quantity) and Sell(optionStrategy, quantity).
And even that is not very helpful when using the Algorithm Framework approach. Below you can find a few suggestions on how we could extend the current OptionStrategy implementation with additional features.
Note, I'm using bullCallSpread = OptionStrategy.BullCallSpread(...) just as an example.

Fetching price details
It would be helpful if we could fetch price details such as the last traded price easily.
Examples:

bullCallSpread.Price 
bullCallSpread.AskPrice 
bullCallSpread.BidPrice 

Emitting insights for Option Strategies
It would be helpful if we could emit insights for option strategies.
Example:
Insight.Price(bullCallSpread, ...)

Position sizing and creating PortfolioTargets
It would be helpful if we could calculate the order quantity for a given target-percent and if we could create PortfolioTarget objects for option strategies as well.
Examples:

CalculateOrderQuantity(bullCallSpread, targetPercentage)
PortfolioTarget(bullCallSpread, quantity)
System Information

QC Cloud

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
  • I have provided detailed steps to reproduce the issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing OptionStrategy implementation and its Buy/Sell usage. Clarify which of price properties, strategy insights, order sizing, and PortfolioTarget support is in scope before coding. Done requires agreed behavior and tests for each selected API.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
fintech-quant
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.