web analytics
< All Topics
Print

Backtesting Covered Calls

Overview

In this tutorial, we will explain how to backtest the Covered Call strategy using the OptionStack platform.

The Covered Call is a strategy that involves selling out-of-the call options against long stock.  

The Covered Call strategy is as follows:

  • Start by buying long stock
  • For every 100 shares of long stock, sell an out-of-the-money call option
  • If the call options expires worthless at expiration, sell another out-of-the-money call option
  • If the call options are in-the-money near expiration, decide whether to:
    • Roll the short call options further out in time / further out-of-the-money
    • Allow the short call options to be assigned into short stock. If the short calls are assigned into short stock, it will effectively cancel out the long stock, resulting in a flat portfolio.
  • Rinse and repeat! 

Run Example!


Long Stock

Let’s start by buying the long stock. Make sure your Initial Cash balance in the Backtest Settings is large enough to support the number of shares of stock bought.

Configure the Strategy block as follows:

  • Strategy: Buy Stock
  • Position Sizing: Size By Quantity
  • Max Open: 1 (only have 1 open stock position at a time)

Sell Call Options

Next, sell out of the money call options against the long stock. For every 100 shares of stock, sell 1 call option.

Configure the Strategy block as follows:

  • Strategy: Sell Call Option
  • Position Sizing: Size By Quantity (# stock shares / 100)
  • Max Open: 1 (only have 1 covered call position at a time)
  • At Expiration: Exercise / Assign or Close At Expiration (can choose to allow positions to be automatically assigned at expiration, or automatically closed at expiration)
  • Strategy filters:
    • Decide which call option to sell
    • Select call options with:
      • daysToExpiration: 20 – 25 days to expiration
      • delta: 28-32 delta

Adjustments (Expires Worthless At Expiration)

If the short call options expire out-of-the money at expiration, there is no adjustment necessary. Simply let them expire worthless, and then sell another out-of-the-money call option after expiration.

In our strategy, this will happen automatically, as we have set the “Max Open = 1“. When one call option position expires, another call option position will be sold automatically.

Adjustments (Assignment of short stock)

If the short call options expires in-the-money at expiration, it will be automatically assigned into short stock. However, since you have your long stock position, it will automatically cancel out your long stock position. This will effectively result in a flat portfolio (with no positions open).

We can then automatically re-start a new covered call position again by buying long stock and selling another call option against it. (i.e. Rinse and Repeat)

This will happen automatically in our strategy. When the short stock is assigned, effectively cancelling out the long stock, a new covered call position will be automatically sold.

Adjustments (Rolling Calls)

If we want to be more aggressive in managing our covered calls, we can roll the covered calls when the stock hits or exceeds the strike price of the short call.

You can find the Blocks to adjust your trades under the Adjust Trades toolbar menu.

Configure the blocks as follows.

This will roll the short call option when the stock exceeds the strike price. It will buy to close the short call option, and sell to open a new call option that has 30 – 40 days to expiration and 28 – 32 delta. The quantity of of short options will remain the same.

Basically, the short call will be rolled further out in time (30 – 40 days) and further out of the money (28 – 32 delta) when the short call has become in-the-money.

Offsetting Positions

By default, once a position is opened, it is considered open unless it has expired or has been explicitly closed by an accompanying order with matching OrderID. This allows you to manage and track each position separately, without worrying whether one trade interferes and overlaps with another trade.

So while the long stock / short stock from the assignments offset each other resulting in a net-zero position, each position is still considered open, since they were offset by different OrderID’s (BuyStock1 / SellCall1).

But in this case, we intentionally want the assignments to offset each other to close all the trades.

In order to change this default behavior, use the consideredPositionsClosedIfOffsetByIndependentPositions setting.

Previous Backtesting Best Practices
Next Backtesting Option Wheel
Table of Contents