QuantConnect / QuantConnect/Lean
Extend `OptionStrategy` with additional functionality
Nobody has claimed this yet.
- 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
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
Contributor 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.
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