Why only buy when you can also sell?

Sotiris Nanopoulos
6 min readMay 10, 2020

Does hedging give you an edge if you are a long term investor? If you buy and hold an index should you even care about hedging?

As a software engineer, who is embarking into the managed portfolio world I was wondering about these questions. To figure the answers, I used the tools available to me. These tools are not from financial theory but merely historical data and Python. I built a simulation that back-tests the performance of a hedging strategy on the Russell Growth index and share my findings. Spoiler alert: hedging is a good idea.

Let’s take a step back… How did we end up here?

One of my resolutions for the new decade was to start a managed stock portfolio. By the time, I got up to speed with the trends and enrolled in a trading platform Covid-19 hit the world. As a millennial, this was the first time I lived through a crisis as an adult, let alone trade in it. During the crisis, I learned so much both about myself and about the markets.

My big takeaway from the crisis is that investing during a crisis is like sailing in a storm.

Inexperienced captains will seal the boat, put down the sails, and wait for the storm to pass. They will survive but with the setback of floating around for the duration of the storm. Experienced captains will continue sailing and use the strong winds to their advantage. Lastly, captains who value a good night's sleep more than anything, will not go out sailing. While it is hard not to sail if you are in the middle of the ocean securities markets are different. You can become market neutral at any time.

Neutrality is achieved by hedging. A hedge is an investment position intended to offset potential losses or gains that may be incurred by an investment. Investors use hedges to protect their portfolios from systematic or market risks. There are various methods to hedge your portfolio. Although this might sound scary or complicated it is easy to understand how it works.

Consider the following example:

  1. We own 1 share of company A which is worth 100$.
  2. We borrow from a good friend (or more realistically our broker) 1 share of A which we immediately sell.
  3. At the end of the day we have 200$ worth of assets (100$ cash and 1 share of A) and 100$ in debt.

The day after we have the following cases based on the price of stock A:

  1. Stock A price increased to 120$. Now we have 220$ worth of assets and 120$ in debt. Total valuation: 100$
  2. Stock A price decreased to 80$. Now we have 180$ worth of assets and 80$ in debt. Total valuation: 100$

Observe that after borrowing the stock we become market neutral. Regardless of the direction of the price our total valuation remained at 100$. The only thing that changed is the composition (cash/debt/stock value) of the assets.

This position is called short selling and it is one type of hedging. This also the type of hedging that we will use in the simulation.

Figuring out the nuts and bolts of the simulation

Now that we have set the background, we can start working towards answering the original question. Can we use the hedging method described above (short selling) to gain an edge over the market?

To determine when we will buy/sell our hedges we will rely on technical indicators. These are indicators that investors use to determine the trend of a stock price. For our strategy, we will calculate the Exponential-Moving-Average (EMA) of the stock price.

An exponential moving average (EMA) is a type of moving average (MA) that places a greater weight and significance on the most recent data points. The exponential moving average is also referred to as the exponentially weighted moving average. An exponentially weighted moving average reacts more significantly to recent price changes than a simple moving average (SMA), which applies an equal weight to all observations in the period.

Source: Investopedia

For the sake of our simulation, we will use the strategy inspired by Puru Saxena. The strategy goes as follows:

  • We will buy hedges when 5 day EMA < 10 day EMA and price < 120 day EMA.
  • We will close our hedges when 5 day EMA >10 day EMA.
  • Hedges cover 100% of the portfolio.

Analyzing the results

Now the fun part starts. We want to test out how our strategy would have performed with real market data.

For our tests we will compare the following scenarios:

Scenario 1: We will buy 5000$ worth of iShares Russell 2000 Growth ETF (IWO) ETF shares at its inception date (2010) and hold them until today.

Scenario 2: We will buy 5000$ worth of IWO shares and hold them until today. Also, we will use short selling to hedge our portfolio. When our hedges are profitable we will re-invest the profits in IWO shares. When our hedges are loss-making we will sell part of the portfolio to pay back our broker.

For both scenarios, we will calculate the valuation the portfolio would have today and its (compounded) annual growth.

The figure below illustrates the price of IWO for the last 5 years. The periods that the portfolio is hedged are highlighted with blue color.

Focus on the downside and the upside will take care of itself

Common knowledge is correct. When we follow a hedging strategy (scenario 2) the valuation of our portfolio grows at much a higher rate. Also, we are able to make profits from our hedging strategies which we can re-invest to fund. The results are actually impressive.

  • Terminal value with long & hold is11412.70$. This means that our fund had a (compounded) annual growth of 8.60%
  • Terminal value with hedging is 53982.30$ (Portfolio: 53903.06 Cash: 79.24). This means that our fund had a (compounded) annual growth of 26.85%
  • Hedging outperforms long & hold by 4.73x
  • The hedging strategy has been consistently profitable.

Some observations

  • The reason why hedging outperforms holding is re-investing. Hedging is profitable on its own. This provides us with extra cash that fuels the fund and increases the overall long position. Let’s take a step back from the simulation and see how this happens with the help of the graph below.

You start with a single A stock. Imagine that at time t1 you hedge stock A and on time t3 you take them off. At t3 your portfolio composition is 1 share ( worth 50$) and 50$ in cash. The hedges protected the portfolio from the price drop, nothing new so far. You can use the extra 50$ in to buy another A stock. Finally at t4 your portfolio is worth 200$.

  • All the calculations are based on the closing price. Now imagine that between opening and closing the price increases arbitrarily high and falls again at close. This simulation would not care about this but our broker might. If the price of the stock increases extremely quickly and there is not sufficient time to remove the hedges it might trigger a margin call.
  • The windows of the EMA can be further optimised (over-fitted 🤷) to (10-day EMA, 15-day EMA, 135-day EMA) for an even better performance annual growth of 32.34%.
  • Even with 15% interest on each short sell position hedging outperforms holding by 3.81x
  • There is no one hedging strategy to rule them all. Different strategies might perform worse (or better) on different ETFs/assets.

The code that I used is available on GitHub. Feel free to test it out

Let’s continue the discussion on Twitter. Reach to me with your comments and thoughts.

Disclaimer

All opinions expressed are my own and do not constitute financial advice in any way whatsoever. Nothing in this article constitutes an investment recommendation, nor should any data or Content published by the writer be relied upon for any investment activities.

Past performance is not indicative of future results, prices/invested sum are subject to market risks which may result in appreciation or depreciation. The ownership of any investment decision(s) shall exclusively vest with the Investor after analyzing all possible risk factors and by exercise of his/her/its independent discretion. I strongly recommend that you perform your own independent research and/or speak with a qualified investment professional before making any financial decisions.

--

--

Sotiris Nanopoulos

All things tech and business | Ideas are free | Opinions are my own | Eng. @Microsoft