QuantConnect / QuantConnect/Lean

No Universe Selection Model for Future Options

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

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

We have a universe selection model for FOP.

Actual Behavior

There is no universe selection model for FOP.

Potential Solution

Add a universe selection model for FOP.

Reproducing the Problem

If you run

from Selection.OptionUniverseSelectionModel import OptionUniverseSelectionModel 

class AdaptableAsparagusMule(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 12, 28)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.SetUniverseSelection(OptionUniverseSelectionModel(timedelta(days=1), self.option_chain_symbol_selector))

    def option_chain_symbol_selector(self, utc_time: datetime) -> List[Symbol]:
        return [Symbol.Create(Futures.Indices.SP500EMini, SecurityType.FutureOption, Market.CME)]

then we get

During the algorithm initialization, the following exception has occurred: Cannot create future option Symbol using this method (insufficient information). Use CreateOption(Symbol, ...) instead.

If we use CreateOption, we have to specify the OptionStyle, OptionRight, Strike, and Expiry instead of getting all of the FOP contracts for the Future.

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 with the OptionUniverseSelectionModel and SetUniverseSelection entry points shown in the reproduction, then inspect how Symbol.Create and CreateOption handle future-option symbols. Done means a universe selection model can select future option contracts without requiring a specific style, right, strike, and expiry for each contract.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, fintech-quant, python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.