Skip to content

GreeksIndicators Yeilds Implied Volatility with Zero Value for 0DTE SPXW in Live Mode #9346

@AlexCatarino

Description

@AlexCatarino

Expected Behavior

Non-zero IV and Greeks for 0DTE SPXW in live mode.

Actual Behavior

Zero IV and Greeks for 0DTE SPXW in live mode
QuantLib models have non-zero values and 1DTE with GreeksIndicators too

Potential Solution

Review implementation. It might be due to expiration since 1DTE works well.

Reproducing the Problem

class IndexOptionAlgorithm(QCAlgorithm):
    def initialize(self):
        Log.debugging_enabled = self.live_mode
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        self.set_cash(100000)
        # Subscribe to the option chain.
        self._option = self.add_index_option("SPX", "SPXW")
        # Filter the option universe to only select 0DTE options.
        self._option.set_filter(-5, 5, 0, 0)
        #self._option.set_price_model(OptionPriceModels.QuantLib.black_scholes())
        self._dividend_yield_model = GreeksIndicators.get_dividend_yield_model("SPX")
        self._interestRateProvider = InterestRateProvider()

    def on_data(self, slice):
        if self.portfolio.invested:
            return

        dividend_yield = self._dividend_yield_model.get_dividend_yield(self.time)
        interest_rate = self._interestRateProvider.get_interest_rate(self.time)
        self.log(f'{dividend_yield=}, {interest_rate=}')

        # Get the option chain data.
        chain = slice.option_chains.get(self._option.symbol)
        if not chain:
            return
        
        for c in chain:
            self.log(f'{c.symbol} {c.implied_volatility} {c.greeks.delta}')

Deployed to QC Paper using Schwab data.

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions