QuantConnect / QuantConnect/Lean
Add OptionChain Helpers
Open
Nobody has claimed this yet.
depth
- Dominant language
- C#
- Stars
- 21.7k
- Forks
- 5.3k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 34
Description
Expected Behavior
Be able to select contracts with helper methods. E.g. CallsOnly().
Actual Behavior
Python Algorithms rely on the following logic:
calls = [x for x in chain if x.Right == OptionRight.Call and x.Expiry == expiry]
that could be simplified with:
calls = chain.ExpiresOn(expiry).CallsOnly()
or
calls_front = chain.FrontExpiry().CallsOnly()
calls_back = chain.BackExpiry().CallsOnly()
Potential Solution
Add these helpers.
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
Locate the OptionChain entry point and inspect how expiry and option-right filtering are currently represented. Add the requested ExpiresOn, CallsOnly, FrontExpiry, and BackExpiry helpers, then verify that the examples produce the equivalent contract selections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100