book
Checkout our new book! Hands on AI Trading with Python, QuantConnect, and AWS Learn More arrow

Option Strategies

Long Call Calendar Spread

Introduction

Long call calendar spread, also known as call horizontal spread, is a combination of a longer-term (far-leg/front-month) call and a shorter-term (near-leg/back-month) call, where all calls have the same underlying stock and the same strike price. The long call calendar spread consists of buying a longer-term call and selling a shorter-term call. This strategy profits from a decrease in the underlying price. It also profits from the time decay value because the theta θ (the Option price decay by 1 day closer to maturity) of the shorter-term call is larger than longer-term call.

Implementation

Follow these steps to implement the long call calendar spread strategy:

  1. In the initialize method, set the start date, end date, cash, and Option universe.
  2. Select Language:
    def initialize(self) -> None:
        self.set_start_date(2017, 2, 1)
        self.set_end_date(2017, 2, 19)
        self.set_cash(500000)
    
        self.universe_settings.asynchronous = True
        option = self.add_option("GOOG", Resolution.MINUTE)
        self._symbol = option.symbol
        option.set_filter(lambda universe: universe.include_weeklys().call_calendar_spread(0, 30, 60))

    The call_calendar_spread filter narrows the universe down to just the two contracts you need to form a long call calendar spread.

  3. In the on_data method, select the strike price and expiration dates of the contracts in the strategy legs.
  4. Select Language:
    def on_data(self, slice: Slice) -> None:
        if self.portfolio.invested:
            return
    
        # Get the OptionChain
        chain = slice.option_chains.get(self._symbol, None)
        if not chain:
            return
    
        # Get the ATM strike
        atm_strike = sorted(chain, key=lambda x: abs(x.strike - chain.underlying.price))[0].strike
    
        # Select the ATM call Option contracts
        calls = [i for i in chain if i.strike == atm_strike and i.right == OptionRight.CALL]
        if len(calls) == 0:
            return
    
        # Select the near and far expiry dates
        expiries = sorted([x.expiry for x in calls])
        near_expiry = expiries[0]
        far_expiry = expiries[-1]
  5. In the on_data method, select the contracts and place the orders.
  6. Approach A: Call the OptionStrategies.call_calendar_spread method with the details of each leg and then pass the result to the buy method.

    Select Language:
    option_strategy = OptionStrategies.call_calendar_spread(self._symbol, atm_strike, near_expiry, far_expiry)
    self.buy(option_strategy, 1)

    Approach B: Create a list of Leg objects and then call the combo_market_order, combo_limit_order, or combo_leg_limit_order method.

    Select Language:
    near_expiry_call = [x for x in calls if x.expiry == near_expiry][0]
    far_expiry_call = [x for x in calls if x.expiry == far_expiry][0]
    
    legs = [
        Leg.create(near_expiry_call.symbol, -1),
        Leg.create(far_expiry_call.symbol, 1)
    ]
    self.combo_market_order(legs, 1)

Strategy Payoff

The long call calendar spread is a limited-reward-limited-risk strategy. The payoff at the shorter-term expiration is

Cshort-termT=(STK)+PT=(Clong-termTCshort-termT+Cshort-term0Clong-term0)×mfee
whereCshort-termT=Shorter term call value at time TClong-termT=Longer term call value at time TST=Underlying asset price at time TK=Strike pricePT=Payout total at time TCshort-term0=Shorter term call value at position opening (credit received)Clong-term0=Longer term call value at position opening (debit paid)m=Contract multiplierT=Time of shorter term call expiration

The following chart shows the payoff at expiration:

Strategy payoff decomposition and analysis of long call calendar spread

The maximum profit is undetermined because it depends on the underlying volatility. It occurs when ST=S0 and the spread of the calls are at their maximum.

The maximum loss is the net debit paid, Cshort-term0Clong-term0. It occurs when the underlying price moves very deep ITM or OTM so the values of both calls are close to zero.

If the Option is American Option, there is a risk of early assignment on the contract you sell. If the buyer exercises the call you sell, you could lose all the debit you received if you don't close the long call and the underlying price drops below the long call strike price.

Example

The following table shows the price details of the assets in the long call calendar spread:

AssetPrice ($)Strike ($)
Longer-term call at the start of the trade4.40835.00
Shorter-term call at the start of the trade36.80767.50
Longer-term call at time T31.35835.00
Underlying Equity at time T829.08-

Therefore, the payoff at time T (the expiration of the short-term call) is

Cshort-termT=(STK)+=(828.07800.00)+=28.07PT=(Clong-termTCshort-termT+Cshort-term0Clong-term0)×mfee=(31.3528.07+11.3020.00)×1001.00×2=544

So, the strategy loses $544.

The following algorithm implements a long call calendar spread Option strategy:

Select Language:
class LongCallCalendarSpreadStrategy(QCAlgorithm): 
    def initialize(self) -> None:
        self.set_start_date(2017, 2, 1)
        self.set_end_date(2017, 2, 19)
        self.set_cash(500000)

        option = self.add_option("GOOG", Resolution.MINUTE)
        self.symbol = option.symbol
        option.set_filter(self.universe_func)

    def universe_func(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:
        return universe.include_weeklys().call_calendar_spread(0, 30, 60)

    def on_data(self, data: Slice) -> None:
        # avoid extra orders
        if self.portfolio.invested: return

        # Get the OptionChain of the self.symbol
        chain = data.option_chains.get(self.symbol, None)
        if not chain: return

        # get at-the-money strike
        atm_strike = sorted(chain, key=lambda x: abs(x.strike - chain.underlying.price))[0].strike

        # filter the call options from the contracts which is ATM in the option chain.
        calls = [i for i in chain if i.strike == atm_strike and i.right == OptionRight.CALL]
        if len(calls) == 0: return

        # sorted the optionchain by expiration date
        expiries = sorted([x.expiry for x in calls], key = lambda x: x)
        
        # select the farest expiry as far-leg expiry, and the nearest expiry as near-leg expiry
        near_expiry = expiries[0]
        far_expiry = expiries[-1]

        option_strategy = OptionStrategies.call_calendar_spread(self.symbol, atm_strike, near_expiry, far_expiry)
        # We open a position with 1 unit of the option strategy
        self.buy(option_strategy, 1)
        # self.sell(option_strategy, 1) if short call calendar spread

Other Examples

For more examples, see the following algorithms:

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: