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

Option Strategies

Covered Call

Introduction

A Covered Call consists of a long position in a stock and a short position in call Options for the same amount of stock. Covered calls aim to profit from the Option premium by selling calls written on the stock you already own. At any time for American Options or at expiration for European Options, if the stock moves below the strike price, you keep the premium and still maintain the underlying Equity position. If the underlying price moves above the strike, the Option buyer can exercise the Options contract, which means you sell your stock at the strike price and keep the premium. Another risk of a covered call comes from the long stock position, which can drop in value.

Implementation

Follow these steps to implement the covered call strategy:

  1. In the initialize method, set the start date, end date, starting cash, and Options universe.
  2. Select Language:
    def initialize(self) -> None:
        self.set_start_date(2014, 1, 1)
        self.set_end_date(2014, 3, 1)
        self.set_cash(100000)
    
        self.universe_settings.asynchronous = True
        option = self.add_option("IBM")
        self._symbol = option.symbol
        option.set_filter(lambda universe: universe.include_weeklys().naked_call(30, 0))

    The naked_call filter narrows the universe down to just the one contract you need to form a covered call.

  3. In the on_data method, select the Option contract.
  4. Select Language:
    def on_data(self, slice: Slice) -> None:
        if self.portfolio.invested:
            return
    
        chain = slice.option_chains.get(self._symbol)
        if not chain:
            return
    
        # Find ATM call with the farthest expiry
        expiry = max([x.expiry for x in chain])
        call_contracts = sorted([x for x in chain
            if x.right == OptionRight.CALL and x.expiry == expiry],
            key=lambda x: abs(chain.underlying.price - x.strike))
    
        if not call_contracts:
            return
    
        atm_call = call_contracts[0]
  5. In the on_data method, place the orders.
  6. Approach A: Call the OptionStrategies.covered_call method with the details of each leg and then pass the result to the buy method.

    Select Language:
    covered_call = OptionStrategies.covered_call(self._symbol, atm_call.strike, expiry)
    self.buy(covered_call, 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:
    legs = [
        Leg.create(atm_call.symbol, -1),
        Leg.create(chain.underlying.symbol, chain.underlying.symbol_properties.contract_multiplier)
    ]
    self.combo_market_order(legs, 1)

Strategy Payoff

The payoff of the strategy is

CKT=(STK)+PT=(STS0+CK0CKT)×mfee whereCKT=Call value at time TST=Underlying asset price at time TK=Call strike pricePT=Payout total at time TS0=Underlying asset price when the trade openedCK0=Call price when the trade opened (credit received)m=Contract multiplierT=Time of expiration

The following chart shows the payoff at expiration:

covered call strategy payoff

The maximum profit is KST+CK0, which occurs when the underlying price is at or above the strike price of the call at expiration.

The maximum loss is S0CK0, which ocurrs when the underlying price drops.

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 ($)
Call3.35185.00
Underlying Equity at start of the trade187.07-
Underlying Equity at expiration190.01-

Therefore, the payoff is

CKT=(STK)+=(190.01185)+=5.01PT=(STS0+CK0CKT)×mfee=(190.01187.07+3.355.01)×mfee=1.28×1002=126

So, the strategy gains $126.

The following algorithm implements a covered call strategy:

Select Language:
class CoveredCallAlgorithm(QCAlgorithm):
    def initialize(self) -> None:
        self.set_start_date(2014, 1, 1)
        self.set_end_date(2014, 3, 1)
        self.set_cash(100000)

        option = self.add_option("IBM")
        self.symbol = option.symbol

        option.set_filter(lambda universe: universe.include_weeklys().naked_call(30, 0))

        self.call = None

        # use the underlying equity as the benchmark
        self.set_benchmark(self.symbol.underlying)

    def on_data(self, slice: Slice) -> None:
        if self.call and self.portfolio[self.call].invested:
            return

        chain = slice.option_chains.get(self.symbol)
        if not chain:
            return

        # Find ATM call with the farthest expiry
        expiry = max([x.expiry for x in chain])
        call_contracts = sorted([x for x in chain
            if x.right == OptionRight.CALL and x.expiry == expiry],
            key=lambda x: abs(chain.underlying.price - x.strike))

        if not call_contracts:
            return

        atm_call = call_contracts[0]

        covered_call = OptionStrategies.covered_call(self.symbol, atm_call.strike, expiry)
        self.buy(covered_call, 1)

        self.call = atm_call.symbol

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: