A play straight from the book. Buying US bonds.

Sotiris Nanopoulos
7 min readJul 13, 2020

Turbulent times right? The first quarter of 2020 was a crazy one and the craziness does not seem to hit the brake. How can we protect our portfolio at crazy time?

The global pandemic caused an unexpected rise in the market. While I can’t complain about my extraordinary returns I remain worried. Events like swine flu, COVID round 2, and the US elections can cause the US securities markets to go through a hard time. I take the time of craziness to prepare myself for the next turbulent period. I am on the lookout for a strategy that would allow me to protect (hedge) my portfolio.

In my previous post Why only buy when can also sell I looked into short selling as a hedging mechanism. Although the strategy is solid, it has high operational costs. For me, the cost translates to moving away from my no-transaction-fees broker (WealthSimple). Instead of bumming out, I accepted the challenge. Find a good hedging strategy that I can execute from WealthSimple. My idea is to revisit a classic move and rely on US treasury bonds when the market is on a downtrend.

To investigate if bonds are a good hedge, I used the tools available to me. As a software engineer, my tools are not from the financial theory toolbox but data analytics and Python. I wrote a Python app to analyze strategies based on historical data (check it out on Github). I used the app to test out my hypothesis and see if buying bonds when the market is down would protect my portfolio in adverse market conditions.

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. I can summarize my learning as:

Protect the downside and the upside will take care of itself

To protect the downside investors rely on 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. For example, if you ever thought about buying gold because the economy was bad then you were thinking about a hedging strategy.

A hedge is a financial product whose price moves in the opposite direction of the portfolio. A useful metric is to determine if a security is a good hedge for a portfolio is its price correlation with the portfolio. Consider the following example. Stock A price in December is 100 and the price in January is 200 and stock B price in December is 100 and the price in January is 50. We say that the two stocks have a -50% price correlation at this period. If the price correlation between the two stocks is -100%, one goes up as much as the other goes down, then buying both would make you market neutral.

Hedging is an important aspect of active portfolio management. It is important because it allows investors to have returns in periods where the markets are down. Also, it reduces the risk and the volatility of the portfolio. Low volatility and low risk are really important for investors who value a good night’s sleep.

How do we know when to apply our hedges?

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

To determine when we will buy/sell our hedges (the signal) 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.

For the sake of our simulation, we will use the strategy described:

  • We will buy hedges when 5 day EMA < 10 day EMA and price < 105 day EMA.
  • We will close our hedges when 5 day EMA >10 day EMA.
  • We will sell out 40% of our portfolio and use the cash to buy the hedges.

Shopping for securities

For our needs, we look for a financial product that would have the following characteristics:

  1. Simple, we embrace our WealthSimple constraint and avoid financial products such as shorting, options, and futures. We want a low maintenance strategy.
  2. We avoid inverse ETF because maths make their returns awkward.
  3. We look for a high inverse correlation (close to -100%) with IWO.

Based on the data available ETFScreen we find the following ETFs that meet our criteria the best:

  • TLT: iShares Barclays 20 Year Treasury Bond Fund. Correlation: -40%
  • VGIT: Vanguard Interm-Term Govt Bd Idx ETF. Correlation: -46%
  • GOVT: iShares Core U.S. Treasury Bond ETF. Correlation: -46%

All of the ETFs above track the performance of US treasury bonds. Their difference is in the maturity rates of the underlying bonds. Note that the correlation of the prices is calculated throughout the lifetime of the ETF. We can do better than that. We can calculate the correlation of the prices only for the periods that we are having our hedges on.

TLT has the highest overall correlation between the three ETFs. However, when IWO is on a downward trend, TLT has the lowest correlation between the three. We care more about downward trends since this is when we plan to buy the ETFs. Based on these facts we expect TLT to have the best performance as a hedge.

The charts below show the distribution of correlation under different hedging periods. The more the distribution is skewed towards -100% the better.

Histogram of TLT ETF correlation with IWO when hedges are on.
Histogram of VGIT ETF correlation with IWO when hedges are on.
Histogram of GOVT ETF correlation with IWO when hedges are on.

Simulating the whole thing

Now the fun part starts. Let’s test out how our strategy would have performed with real market data.

For our tests we will compare the following scenarios:

  • Scenario 1 (Baseline): 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 TLT to hedge our portfolio. When we sell our hedges we use our to buy more IWO shares.
  • Scenario 3: Same as scenario 2 except that we will buy VGIT to hedge our portfolio
  • Scenario 4: Same as scenario 2 (and 3) except that we will buy GOVT to hedge our portfolio

For all the 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.

https://cdn-images-1.medium.com/max/2400/1*HujKFE_u1tU54HlWtZcBkA.png

The results demonstrate that TLT has been acting as an effective hedge for IWO. More specifically:

  1. Fund duration: 17.93 years
  2. Scenario 1(Baseline Strategy): Valuation today: 24824.40$ and CAGR: 9.21%
  3. Scenario 2 (TLT hedged): Valuation today: 64350.84$ (Portfolio: 64336.57$ Cash: 14.27$) and CAGR of 15.09%
  4. Scenario 2 valuation today is larger than baseline by 2.59x

The median and average hedge are also profitable. This is extremely important because it gives us extra cash. This cash is allocated back to the fund at the end of the hedging period. Based on the histogram below we can see that most hedges are hovering around 0. This means that we neither make nor lose money from our hedges. This particularly good since by definition IWO price is dropping when our hedges are applied.

Histogram of TLT hedge performance. We observe that in the majority of cases TLT is a profitable hedge and in many cases, it substantially increases our profits.

In the table below we see how the same strategy compares when we use different ETFs to hedge our long position. For each ETF we determine how the strategy would have performed throughout its lifetime. Since the lifetime of the funds is different, we compare the returns with the returns of IWO during the same period. Finally, we calculate the valuation of our portfolio. Based on the results VGIT and GOVT bearly outperform the baseline.

Table of results for all scenarios and comparisons with their baseline.

The code that I used is available on GitHub. Feel free to test it out and/or open an issue if you encounter any problem.

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