# How to Hedge a Portfolio with Put Options

There are 2 good reasons to buy put options:

- because you think they are cheap
- because you want downside protection.

In the latter case, you are looking to use the skewed payoff profile of the put option to protect a portfolio against large downside moves without capping your upside too much.

The first requires a pricing model. Or, at the least, an understanding of when and under what conditions put options tend to be cheap.

The second doesn’t necessarily. We’ll assume that we’re going to have to pay a premium to protect our portfolio – and that not losing a large amount of money is more important than the exact price we pay for it.

Let’s run through an example…

We have a portfolio comprised entirely of 100 shares of SPY. About $29k worth.

We can plot a payoff profile for our whole portfolio. This is going to show the dollar P&L from our portfolio at various SPY prices.

At the time of writing, SPY closed at $287.05

if (!require("pacman")) install.packages("pacman") pacman::p_load(tidyverse, rvest, slider, tidyquant, alphavantager, kableExtra)

SPYprice <- 287.05 SPYshares <- 100 min_price <- 140 max_price <- 440 portfolio_payoffs <- tibble(price = c(min_price, max_price)) %>% mutate(pnl = (price - SPYprice) * SPYshares) portfolio_payoffs %>% ggplot(aes(x = price, y = pnl)) + geom_line() + ggtitle('PnL of Portfolio vs SPY Price')

So far, so unremarkable…

Now let’s say we want to limit our downside to no more than $5,000 (from current levels) over the next 3 months.

*That’s about a 17% decline from current prices.*

First, we look at the SPY price which results in about a $5,000 loss. From eyeballing the chart, that’s about $240.

Let’s do it with code…

minlossprice <- SPYprice -5000 / SPYshares minlossprice

## [1] 237.05

Next, remember that **a SPY put option struck at or near $240 gives us the option to sell 100 SPY shares at $240, regardless of the price of SPY.**

If we buy a 17 July $240 SPY put, then we have capped our minimum possible portfolio loss to -$5,000.

If we take the last traded price for that put option contract then that “insurance” costs us about $5.19 per share. SPY options are options on 100 shares so that “insurance” costs us $519 in Premium.

So for $519 (which is about 1.8% of our portfolio), we can “insure” our portfolio so it doesn’t drop any more than -$5,000 from current prices.

strike <- 240 premium <- 5.19 portfolio_payoffs_hedged <- tibble(price = c(min_price:max_price)) %>% mutate(pnl = case_when( price < strike ~ (strike - SPYprice - premium)*SPYshares, TRUE ~ (price - SPYprice - premium)*SPYshares )) portfolio_payoffs_hedged %>% ggplot(aes(x = price, y = pnl)) + geom_line() + geom_vline(xintercept = strike, linetype = 'dashed') + annotate(geom = 'text', label = paste('Strike = ', strike), x = strike-50, y = -2500, ) + ggtitle('PnL of Hedged Portfolio vs SPY Price')

Whether this is valuable to you depends on what you’re trading and what your risk tolerance is.

*More on this at the end of the post…*

## But I don’t have a portfolio of just SPY!

Ok, so it’s highly unlikely that your portfolio is made up entirely of 100 shares of SPY!

So let’s look at an example of hedging a degenerate portfolio of small caps using SPY puts.

First, get some price history for SPY and a few small caps from AlphaVantage:

tickers <- c('NOG', 'SWN', 'ACB', 'DO', 'SPY') MY_API_KEY <- getOption("AV_API_KEY") av_api_key(MY_API_KEY) prices <- tq_get( tickers, get = 'alphavantager', av_fun = 'TIME_SERIES_DAILY_ADJUSTED', outputsize = 'full' ) prices <- prices %>% filter(timestamp >= '2015-01-01') %>% group_by(symbol) %>% mutate(returns = adjusted_close / lag(adjusted_close) - 1) prices %>% ggplot(aes(x = timestamp, y = adjusted_close, colour = symbol)) + geom_line()

Next, calculate our portfolio’s beta to SPY. We’ll assume we’re invested equal weight in these stocks.

portfolio_returns <- prices %>% filter(symbol != 'SPY') %>% group_by(timestamp) %>% summarise(port = mean(returns)) %>% left_join( prices %>% filter(symbol == 'SPY') %>% select(symbol, timestamp, returns), by = 'timestamp' ) %>% select(timestamp, port, returns) %>% rename('spy' = returns) portfolio_returns %>% ggplot(aes(x = spy, y = port)) + geom_point() + geom_smooth(method = lm, formula = y ~ x)

Estimate a 100-day rolling beta of our portfolio to SPY:

get_beta <- function(x) { mod <- lm(port ~ spy, data = x) return(mod$coefficients['spy']) } portfolio_returns <- portfolio_returns %>% mutate(rollbeta = slide_dbl(., ~get_beta(.x), .before = 100, .complete = TRUE)) portfolio_returns %>% ggplot(aes(x = timestamp, y = rollbeta)) + geom_line()

Let’s take our portfolio beta at the current 100-day rolling estimate. You can see that the estimate is rather noisy – this won’t be too precise.

port_beta <- portfolio_returns %>% select(rollbeta) %>% last() %>% pull() port_beta

## [1] 1.266401

Our portfolio beta is about 1.27.

That means that for every dollar invested in our portfolio, we would need to hedge 1.27 dollars worth of SPY.

Let’s say our portfolio is worth $50,000. That means we need to hedge $63,500 of SPY. Given the current SPY price

port_value <- 50000 SPYprice <- 287 shares_of_spy <- port_value*port_beta/SPYprice shares_of_spy

## [1] 220.6274

Now, we can only hedge to the nearest 100 shares of SPY (told you this can’t get too precise…). So, in this case, we’d buy two SPY puts and call ourselves slightly underhedged. You could on the other hand by 3 puts and find yourself slightly over hedged.

What’s the optimal thing to do?

Well, everything is a trade-off. Being underhedged costs less in the premium you pay, but leaves you…well…underhedged. Being over hedged costs you more in premium, but leaves you more than adequately protected.

Portfolio hedging with index put options, in reality, requires juggling of *basis risk* (you can only hedge in 100 share units) and *correlation risk* – where correlation risk is the risk of hedging on the basis of the betas of the components of your portfolio.

## So should I hedge my portfolio with index put options?

That depends on:

- your trading edge
- what risk you’re taking in the portfolio
- what your risk tolerance is

If you’re running a highly leveraged portfolio of negatively skewed carry-trades, for example, then there is a time in the future when you will lose a large amount of money very quickly.

Losing a lot of money is bad. And making sure you don’t lose a lot of money is more important than the exact price you pay for that insurance. So provided you do indeed have a large edge, I would recommend you pay up for crash protection.

However, this assumes you have a significant trading edge. Portfolio insurance is costly, so you need to be confident that you have a large edge which is significantly greater than the cost you’re going to pay to hedge your downside.

If you aren’t confident in your trading edge, then you would be much better sizing your trading down to a point where you are happy taking on the downside risk.

## Summary

In this lesson, we’ve been through a very simple approach to hedging a simple portfolio of equity-like assets.

It’s an approach that doesn’t require an options pricing model, just an appreciation of how much you are willing to pay for downside protection given a realistic assessment of your trading edge.

*In a future lesson, we’ll look at how we might be able to get a similar level of protection cheaper by looking at “less precise” hedges using baskets of put options in single name stocks and other risk assets…*

## (3) Comments

[…] we’re looking to buy “out of the money” put options for crash protection then we’re really just interested in the behaviour of the stock during severe market […]

[…] couple of weeks ago, we explained how you can use SPY put options to protect your portfolio against severe market […]

Apologies I just cross posted accidentally in the other protection thread.

What if SPY moves against me and what expiry monthly vs weekly etc?