Lean icon indicating copy to clipboard operation
Lean copied to clipboard

No Universe Selection Model for Future Options

Open DerekMelchin opened this issue 3 years ago • 0 comments

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

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

DerekMelchin avatar Jun 29 '22 18:06 DerekMelchin