---
title: "Universes"
description: "Request Future Options data in your algorithm to receive a feed of contract prices in the OnData method."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/future-options/requesting-data/universes
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/future-options/requesting-data/universes.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/03%20Securities/99%20Asset%20Classes/07%20Future%20Options/01%20Requesting%20Data/01%20Universes
modified: 2026-11-01
index: https://www.quantconnect.com/llms.txt
---

# Universes

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Securities > [Asset Classes](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes.md) > [Future Options](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/future-options.md) > [Requesting Data](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/future-options/requesting-data.md) > Universes

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

The `add_future_option` method enables you to select a basket of Option contracts for an underlying Future. To form your universe of contracts, you can filter them down by their strike price and expiry or you can choose a subset of the contracts that form popular [Option strategies](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies.md). If you want to subscribe to individual contracts one-by-one instead of a set of contracts, see [Individual Contracts](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/future-options/requesting-data/individual-contracts.md).

## Create Universes

To add a universe of Future Option contracts, in the `initialize` method, call the `add_future_option` method. Pass the `option_filter` argument to filter the set of tradable contract down to just the contracts you want.

```python
class BasicFutureOptionAlgorithm(QCAlgorithm):
    def initialize(self):
        self._future = self.add_future(Futures.Indices.SP_500_E_MINI,
            extended_market_hours=True,
            data_mapping_mode=DataMappingMode.OPEN_INTEREST,
            data_normalization_mode=DataNormalizationMode.BACKWARDS_RATIO,
            contract_depth_offset=0)
        self._future.set_filter(0, 182)

        self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.strikes(-1, 1))

    def on_data(self, data):
        # Iterate all Option chains to find the desired future and future options contracts
        for canonical_symbol, chain in data.option_chains.items():
            future_contract = canonical_symbol.underlying
            for symbol, contract in chain.contracts.items():
                strike = contract.strike

        # Get the Option chain for the mapped contract
        mapped_chain = data.option_chains.get(Symbol.create_canonical_option(self._future.mapped))
        if mapped_chain:
            for symbol, contract in mapped_chain.contracts.items():
                strike = contract.strike
```

For more information about the `add_future_option` method, see [Create Universes](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/future-options.md#02-Create-Universes).

## Filter by Investment Strategy

[Options trading strategies](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies.md) consist of simultaneously buying or selling one or more Option contracts of the same underlying Future with different features. The following table describes the filter methods of the `OptionFilterUniverse` class that select contract for Option strategies.

The following table describes the filter methods of the `OptionFilterUniverse` class that select contracts for Option strategies:

`naked_call(min_days_till_expiry: int, strike_from_atm: float)`

Selects a call contract to form [Naked Call](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/naked-call.md), [Covered Call](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/covered-call.md), or [Protective Call](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/protective-call.md) Option strategies.

`naked_put(min_days_till_expiry: int, strike_from_atm: float)`

Selects a put contract to form [Naked Put](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/naked-put.md), [Covered Put](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/covered-put.md), or [Protective Put](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/protective-put.md) Option strategies.

`call_spread(min_days_till_expiry: int, higher_strike_from_atm: float, lower_strike_from_atm: float)`

Selects two call contracts to form [Bull Call Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bull-call-spread.md) or [Bear Call Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bear-call-spread.md) Option strategies.

`put_spread(min_days_till_expiry: int, higher_strike_from_atm: float, lower_strike_from_atm: float)`

Selects two put contracts to form [Bull Put Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bull-put-spread.md) or [Bear Put Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bear-put-spread.md) Option strategies.

`call_calendar_spread(strike_from_atm: int, min_near_days_till_expiry: int, min_far_days_till_expiry: int)`

Selects two call contracts to form [Long Call Calendar Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-call-calendar-spread.md) or [Short Call Calendar Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-call-calendar-spread.md) Option strategies.

`put_calendar_spread(strike_from_atm: int, min_near_days_till_expiry: int, min_far_days_till_expiry: int)`

Selects two put contracts to form [Long Put Calendar Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-put-calendar-spread.md) or [Short Put Calendar Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-put-calendar-spread.md) Option strategies.

`strangle(min_days_till_expiry: int, higher_strike_from_atm: float, lower_strike_from_atm: float)`

Selects two contracts to form [Long Strangle](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-strangle.md) or [Short Strangle](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-strangle.md) Option strategies.

`straddle(min_days_till_expiry: int)`

Selects two contracts to form [Long Straddle](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-straddle.md) or [Short Straddle](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-straddle.md) Option strategies.

`protective_collar(min_days_till_expiry: int, higher_strike_from_atm: float, lower_strike_from_atm: float)`

Selects two contracts to form [Protective Collar](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/protective-collar.md) Option strategies.

`conversion(min_days_till_expiry: int, strike_from_atm: float)`

Selects two contracts to form [Conversion](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/conversion.md) or [Reverse Conversion](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/reverse-conversion.md) Option strategies.

`call_butterfly(min_days_till_expiry: int, strike_spread: float)`

Selects three contracts to form [Long Call Butterfly](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-call-butterfly.md) or [Short Call Butterfly](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-call-butterfly.md) Option strategies.

`put_butterfly(min_days_till_expiry: int, strike_spread: float)`

Selects three contracts to form [Long Put Butterfly](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-put-butterfly.md) or [Short Put Butterfly](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-put-butterfly.md) Option strategies.

`iron_butterfly(min_days_till_expiry: int, strike_spread: float)`

Selects four contracts to form [Long Iron Butterfly](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-iron-butterfly.md) or [Short Iron Butterfly](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-iron-butterfly.md) Option strategies.

`iron_condor(min_days_till_expiry: int, near_strike_spread: float, far_strike_spread: float)`

Selects four contracts to form [Long Iron Condor](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-iron-condor.md) or [Short Iron Condor](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-iron-condor.md) Option strategies.

`box_spread(min_days_till_expiry: int, strike_spread: float)`

Selects four contracts to form [Box Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-box-spread.md) or [Short Box Spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-box-spread.md) Option strategies.

`jelly_roll(strike_from_atm: float, min_near_days_till_expiry: int, min_far_days_till_expiry: int)`

Selects four contracts to form [Jelly Roll](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/long-jelly-roll.md) or [Short Jelly Roll](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/short-jelly-roll.md) Option strategies.

`call_ladder(min_days_till_expiry: int, higher_strike_from_atm: float, middle_strike_from_atm: float, lower_strike_from_atm: float)`

Selects four contracts to form [Bear Call Ladder](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bear-call-ladder.md) or [Bull Call Ladder](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bull-call-ladder.md) Option strategies.

`put_ladder(min_days_till_expiry: int, higher_strike_from_atm: float, middle_strike_from_atm: float, lower_strike_from_atm: float)`

Selects four contracts to form [Bear Put Ladder](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bear-put-ladder.md) or [Bull Put Ladder](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bull-put-ladder.md) Option strategies.

The preceding methods return an `OptionFilterUniverse`, so you can chain the methods together.

```python
# Example 1: Select a Straddle
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.straddle(30, 5, 10))

# Example 2: Select the contracts (including weeklys) that expire in the next 30 days that form an Iron Condor
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.strikes(-20, 20).expiration(0, 30).iron_condor(30, 5, 10))

# Example 3: Select the front month contracts that form an Strangle
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.front_month().strangle(30, 5, -10))
```

## Filter by Other Contract Properties

To set a contract filter, in the `initialize` method, call the `add_future_option` method and pass the `option_filter` argument.

```python
# Select contracts that have a strike price within 1 strike level above and below the underlying price
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.strikes(-1,1))

# Select contracts that expire within 30 days
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.expiration(0,30))

# Select contracts that have a strike price within 1 strike level and expire within 30 days
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.strikes(-1,1).expiration(0,30))

# Select call contracts
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.calls_only())
```

The following table describes the filter methods of the `OptionFilterUniverse` class:

`strikes(min_strike: int, max_strike: int)`

Selects contracts that are within `m_strike` strikes below the underlying price and `max_strike` strikes above the underlying price.

`calls_only()`

Selects call contracts.

`puts_only()`

Selects put contracts.

`standards_only()`

Selects standard contracts.

`weeklys_only()`

Selects weekly contracts. This filter doesn't currently work. To add this functionality to [our roadmap](https://www.quantconnect.com/docs/v2/lean-engine/getting-started.md#05-Roadmap), react to [this GitHub Issue](https://github.com/QuantConnect/Lean/issues/7570) with a thumbs up emoji.

`front_month()`

Selects the front month contract.

`back_months()`

Selects the non-front month contracts.

`back_month()`

Selects the back month contracts.

`expiration(min_expiryDays: int, max_expiryDays: int)`

Selects contracts that expire within a range of dates relative to the current day.

`contracts(contracts: list[Symbol])`

Selects a list of contracts.

`contracts(contract_selector: Callable[[list[Symbol]], list[Symbol]])`

Selects contracts that a selector function selects.

The preceding methods return an `OptionFilterUniverse`, so you can chain the methods together.

The preceding methods return an `OptionFilterUniverse`, so you can chain the methods together.

```python
# Example 1: Select the front month call contracts
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.calls_only().front_month())

# Example 2: Select the contracts that expire in the next 90 days
self.add_future_option(self._future.symbol, lambda option_filter_universe: option_filter_universe.strikes(-20, 20).expiration(0, 90))
```

To perform thorough filtering on the `OptionFilterUniverse`, define an isolated filter method.

```python
class BasicFutureOptionAlgorithm(QCAlgorithm):
    def initialize(self):
        self.add_future_option(self._future.symbol, self._selector)

    def _selector(self, option_filter_universe: OptionFilterUniverse) -> OptionFilterUniverse:
        symbols = list(option_filter_universe.puts_only())
        strike = min([symbol.id.strike_price for symbol in symbols])
        symbols = [symbol for symbol in symbols if symbol.id.strike_price == strike]
        return option_filter_universe.contracts(symbols)
```

Some of the preceding filter methods only set an internal enumeration in the `OptionFilterUniverse` that it uses later on in the filter process. This subset of filter methods don't immediately reduce the number of contract `Symbol` objects in the `OptionFilterUniverse`.

## Default Filter

By default, LEAN subscribes to the Option contracts that have the following characteristics:

- Standard and weeklys
- Within 1 strike price of the underlying asset price
- Expire within 35 days

To adjust the universe of contracts, set a filter. The filter usually runs at the first bar of every day. When the filter selects a contract that isn't currently in your universe, LEAN adds the new contract data to the next `Slice` that it passes to the `on_data` method.

## Historical Data

To get historical data for a Future Options universe, see [Historical Data](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/future-options.md#05-Historical-Data).

## Examples

The following examples demonstrate some common practices for requesting Future Option data through universe filtering.

### Example 1: Call Spread

The following example demonstrates how to implement a [bull call spread](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/bull-call-spread.md) option strategy using universe filtering. We have to first subscribe to the underlying Future (with filtering), then call `self.add_future_option` with the underlying `Symbol` and the filtering function. We use `call_spread` method in the `OptionFilterUniverse` object to return only the 2 best match call contracts that forms a bull call spread.

```python
class FutureOptionAlgorithm(QCAlgorithm):
    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        # Filter the underlying continuous Futures to narrow the FOP spectrum.
        self.underlying = self.add_future(Futures.Indices.SP_500_E_MINI,
            extended_market_hours=True,
            data_mapping_mode=DataMappingMode.OPEN_INTEREST,
            data_normalization_mode=DataNormalizationMode.BACKWARDS_RATIO,
            contract_depth_offset=0)
        self.underlying.set_filter(0, 182)
        # Use CallSpread filter to obtain the 2 best-matched contracts that forms a call spread.
        # It simplifies from further filtering and reduce computation on redundant subscription.
        self.add_future_option(self.underlying.symbol, lambda u: u.call_spread(5, 5, -5))

    def on_data(self, slice: Slice) -> None:
        if self.portfolio.invested:
            return
        # Create canonical symbol for the mapped future contract, since we need that to access the option chain.
        symbol = Symbol.create_canonical_option(self.underlying.mapped)

        # Get option chain data for the mapped future only.
        # It requires 2 contracts with different strikes to form a call spread, so we make sure at least 2 contracts are present.
        chain = slice.option_chains.get(symbol)
        if not chain or len(list(chain)) < 2:
            return

        # Separate the contracts by strike, as we need to access their strike.
        expiry = min([x.expiry for x in chain])
        sorted_by_strike = sorted([x.strike for x in chain])
        itm_strike = sorted_by_strike[0]
        otm_strike = sorted_by_strike[-1]

        # Use abstraction method to order a bull call spread to avoid manual error.
        option_strategy = OptionStrategies.bull_call_spread(symbol, itm_strike, otm_strike, expiry)
        self.buy(option_strategy, 1)
```

Note that since both the underlying Future and the Future Option are expiring on the same day and are cash-settling in most cases, Lean can exercise the Future Option into account cash automatically at expiry and we do not need to handle the option exercise/assignment event.
