Introduction

The expiration date for an Options contract is the time when the contract is no longer valid. The expiration date for listed stock Options in the United States is usually the third Friday of the contract month, which is the month when the contract expires. When that Friday falls on a holiday, the expiration date is on Thursday immediately before the third Friday. The Options expiration week is a week before Options expiration.

During Option-expiration weeks, a reduction occurs in Option open interest as the near-term Options approach their expiration and then expire. According to a research from Chris and Licheng Returns and Option activity over the Option-expiration week for S&P 100 stocks, large-cap stocks with actively traded Options tend to have higher average weekly returns during Option-expiration weeks. In this algorithm, we'll use the real market data to explore the Option expiration week effect.

Method

The S&P 100 index includes 102 leading U.S. stocks with exchange-listed Options. The constituents represent almost 51% of the market capitalization of the U.S. Equity market. Here we trade the S&P 100 index ETF as a portfolio of U.S. large-cap stocks.

In the next step, we add the Options to get their expiration dates. The range of expiration dates should bigger enough to include the the contract which expires in this month.

def Initialize(self):
    self.SetStartDate(2007, 1, 1)
    self.SetEndDate(2018, 8, 1)
    self.SetCash(10000)
    self.AddEquity("OEF", Resolution.Minute)
    option = self.AddOption("OEF")
    option.SetFilter(-3, 3, timedelta(0), timedelta(days = 60))
    self.SetBenchmark("OEF")

To get a list of expiration dates from the contracts in the current Option chain, we can use TradingCalendar object. It allows us to filter the calendar days by the type TradingDayType.OptionExpiration and the start as well as the end date. The expiry at the top of the list is the most recent expiration date.

The long position is opened at the start of the expiration week. Therefore, we use a Scheduled Event to fire the Rebalance method every Monday. If the current Monday is in the expiration week, we long the S&P 100 index ETF.

def Rebalance(self):
    calendar = self.TradingCalendar.GetDaysByType(TradingDayType.OptionExpiration, self.Time, self.EndDate)
    expiries = [i.Date for i in calendar]
    if len(expiries) == 0: return
    self.lastest_expiry = expiries[0]

    if (self.lastest_expiry - self.Time).days <= 5:
        self.SetHoldings("OEF", 1)

The algorithm stays in cash during days out of the options expiration week.

def OnData(self, slice):
    if self.Time.date() == self.lastest_expiry.date():
        self.Liquidate()


Reference

  1. Quantpedia - Option Expiration Week Effect

Author