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

Option Strategies

Bull Call Spread

Introduction

Bull call spread, also known as long call spread, consists of buying an ITM call and selling an OTM call. Both calls have the same underlying Equity and the same expiration date. The OTM call serves as a hedge for the ITM call. The bull call spread profits from a rise in underlying asset price.

Implementation

Follow these steps to implement the bull call 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, 3, 5)
        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_spread(30, 5))

    The call_spread filter narrows the universe down to just the two contracts you need to form a bull call spread.

  3. In the on_data method, select the expiration and strikes 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
        
        # Select the call Option contracts with the furthest expiry
        expiry = max([x.expiry for x in chain])
        calls = [i for i in chain if i.expiry == expiry and i.right == OptionRight.CALL]
        if not calls == 0:
            return
    
        # Select the ITM and OTM contract strike prices from the remaining contracts
        strikes = [x.strike for x in calls]
        otm_strike = max(strikes)
        itm_strike = min(strikes)
  5. In the on_data method, select the contracts and place the orders.
  6. Approach A: Call the OptionStrategies.bull_call_spread method with the details of each leg and then pass the result to the buy method.

    Select Language:
    option_strategy = OptionStrategies.bull_call_spread(self._symbol, itm_strike, otm_strike, 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:
    itm_call = [x for x in calls if x.strike == itm_strike][0]
    otm_call = [x for x in calls if x.strike == otm_strike][0]
    
    legs = [
        Leg.create(itm_call.symbol, 1),
        Leg.create(otm_call.symbol, -1)
    ]
    self.combo_market_order(legs, 1)

Strategy Payoff

The bull call spread is a limited-reward-limited-risk strategy. The payoff is

COTMT=(STKOTM)+CITMT=(STKITM)+PT=(CITMTCOTMT+COTM0CITM0)×mfee whereCOTMT=OTM call value at time TCITMT=ITM call value at time TST=Underlying asset price at time TKOTM=OTM call strike priceKITM=ITM call strike pricePT=Payout total at time TCITM0=ITM call value at position opening (debit paid)COTM0=OTM call value at position opening (credit received)m=Contract multiplierT=Time of expiration

The following chart shows the payoff at expiration:

Strategy payoff decomposition and analysis of bull call spread

The maximum profit is KOTMKITM+COTM0CITM0. If the underlying price increases to exceed both strikes at expiration, both calls are worth (STK) at expiration.

The maximum loss is the net debit you paid to open the position, COTM0CITM0.

If the Option is American Option, there is a risk of early assignment on the contract you sell.

Example

The following table shows the price details of the assets in the algorithm:

AssetPrice ($)Strike ($)
OTM call3.00835.00
ITM call41.00767.50
Underlying Equity at expiration829.08-

Therefore, the payoff is

COTMT=(STKOTM)+=(829.08835.00)+=0CITMT=(STKITM)+=(829.08767.50)+=61.58PT=(CITMTCOTMT+COTM0CITM0)×mfee=(61.580+3.0041.00)×1001.00×2=2356

So, the strategy profits $2,356.

The following algorithm implements a bull call spread strategy:

Select Language:
class BullCallSpreadStrategy(QCAlgorithm): 
    def initialize(self) -> None:
        self.set_start_date(2017, 2, 1)
        self.set_end_date(2017, 3, 5)
        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_spread(30, 5)

    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 furthest expiration date of the contracts
        expiry = sorted(chain, key = lambda x: x.expiry, reverse=True)[0].expiry
        
        # Select the call Option contracts with the furthest expiry
        calls = [i for i in chain if i.expiry == expiry and i.right == OptionRight.CALL]
        if len(calls) == 0: return

        # Select the ITM and OTM contract strike prices from the remaining contracts
        call_strikes = sorted([x.strike for x in calls])
        itm_strike = call_strikes[0]
        otm_strike = call_strikes[-1]

        option_strategy = OptionStrategies.bull_call_spread(self.symbol, itm_strike, otm_strike, expiry)
        self.buy(option_strategy, 1)

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: