S&P 500 leveraged ETF analysis

Context and introduction

Defying pundits, leveraged ETFs have significantly outperformed their respective base funds since their inception in the early 2010s. Originally seen as a short-term instrument, historical data from the past 10 years has since provided compelling evidence that such leveraged funds can consistently provide higher returns over the medium to long term timeframe (5-10 years). Despite covid-19 precipitating the worst market rout in history, both the TQQQ and SPXL are still furnishing outsized returns relative to their respective base indexes when tracked from their inception.

The obvious question at the back of the investors' minds is if this is too good to be true - if there lie hidden risks and conditions under which even a long time horizon is unable to offset the relative volatility and downward propensity of a leveraged ETF. Notably, some have warned of volatility as the achilles' heel of leveraged ETFs. As such, this analysis will centre on a quantiative simulation of a 3X leveraged fund, using both historical and generated data to determine if leveraged ETFs are inevitably the winning horse for a passive investor's long run race.

The following analysis broadly seeks to illustrate and prove the following two points:

1. Leveraged ETFs require two conditions to be satisfied in order for outsized returns to be available in the long run. The obvious first condition is that markets continue to trend upwards. The second condition is that markets do not become significantly more volatile. If volatility were to increase due to uncertainty, then leveraged ETFs may not necessarily be the long-run winner.
2. Timing becomes all the more important when purchasing leveraged ETFs, and investors should adopt a dollar cost averaging strategy to prevent large long-term losses in the face of bear markets

An additional note is that this was written in June of 2020. I may come back to update this in the future but in case I do not, do take this notebook with a pinch of hindsight salt. Future data may prove past analysis very wrong indeed.

SPXL_YahooFinanceChart.png The SPXL 3X leverage ETF massively outperforms the underlying S&P 500 index over the 2010s

Data preparation

Casual readers can consider skipping this section, going directly to the section on simulation. The steps done here are largely preparation for subsequent steps ahead. Crucially, the percentage gain or loss is calculated here. The 3X gains/losses are then calculated based on those values. If the base index gains 3% in a day, the leveraged ETF gains 9%. If it loses 2%, the leveraged ETF loses 6%.

Also of note is the fact that our dataset comprises data from 1978-2020. It is obtained from the Wall Street Journal.

In [364]:
import pandas as pd
import datetime
from functools import reduce
In [365]:
dataset = pd.read_csv("HistoricalPrices.csv")
dataset = dataset.set_index(pd.DatetimeIndex(dataset["Date"]))
In [366]:
dataset = dataset[["Close"]]
dataset = dataset.sort_index().dropna()
In [367]:
def set_return_percentages(dataset, close_column):
    df = dataset.copy()
    
    # Calculate daily returns of S&P 500 index
    previous_day_closing_price = df.shift()[close_column]
    difference_in_closing_prices = df[close_column] - previous_day_closing_price

    df["return_percentage"] = difference_in_closing_prices/previous_day_closing_price
    
    # Calculate returns of 3X leveraged ETF
    df["leveraged_return_percentage"] = df["return_percentage"]*3
    
    return df.dropna()
In [368]:
dataset = set_return_percentages(dataset,"Close")
In [369]:
dataset
Out[369]:
Close return_percentage leveraged_return_percentage
Date
1978-01-04 93.52 -0.003198 -0.009593
1978-01-05 92.74 -0.008340 -0.025021
1978-01-06 91.62 -0.012077 -0.036230
1978-01-09 90.64 -0.010696 -0.032089
1978-01-10 90.17 -0.005185 -0.015556
... ... ... ...
2020-06-15 3066.59 0.008312 0.024937
2020-06-16 3124.74 0.018962 0.056887
2020-06-17 3113.49 -0.003600 -0.010801
2020-06-18 3115.34 0.000594 0.001783
2020-06-19 3097.74 -0.005649 -0.016948

10708 rows × 3 columns

Simulation

As discussed above, leveraged ETFs are a recent invention, with the most popular ones emerging between 2008-2010. As such, there isn't multi-decade historical data upon which to base our analysis on. To get around this problem, we have already generated per-day 3X returns using our dataset which dates back to 1978. This section builds on that and runs simulations using various investment time frames, with the goal of determining if the returns of leveraged ETFs holds up to scrutiny over the long run.

In [370]:
# Configurable variables

STARTING_DATE = datetime.datetime(1978,1,4)
ENDING_DATE = datetime.datetime(2020,6,19)
BASE_VALUE = 100 #Normalise both leveraged and non leveraged funds for comparison
In [371]:
def run_simulation(BASE_VALUE, list_of_percentages):
    simulated_history = []
    
    def apply_next_return_percentage(current_value, change):
        new_value = current_value + current_value*change
        simulated_history.append(new_value)
        
        return new_value
    
    reduce(apply_next_return_percentage, list_of_percentages, BASE_VALUE)
    
    return simulated_history

def plot_simulation(BASE_VALUE, dataset, STARTING_DATE, ENDING_DATE, title):
    subset = dataset.copy()[STARTING_DATE:ENDING_DATE]
    subset["SPXL Simulated"] = run_simulation(BASE_VALUE, subset["leveraged_return_percentage"])
    subset["S&P 500"] = run_simulation(BASE_VALUE, subset["return_percentage"])
    
    _ = subset[["SPXL Simulated","S&P 500"]].plot(figsize=(15,10), title=title)

Baseline - simulated returns from 1978 to 2020

The SPXL is the clear winner over the simulated period of 1978 to 2020. Theoretically, an investor who put $100 in the simulated leveraged ETF in 1978 would have had that $100 grow to almost $100,000 at its peak in 2020, before Covid-19.

In [372]:
STARTING_DATE = datetime.datetime(1978,1,4)
ENDING_DATE = datetime.datetime(2020,6,19)

plot_simulation(BASE_VALUE, dataset, STARTING_DATE, ENDING_DATE, "Comparison of returns between S&P 500 and simulated SPXL, 1978-2020")

What if an investor got into the market in the late 1990s?

The results are less clear if an investor had invested about a year or two before the dot-com bubble burst in 2001. The investor would have seen returns that trailed the S&P for more than 2 decades, which even for passive, long term investing is a long period. While the S&P 500 would have seen the investor hold onto a 75% return on his 1999 investment at the worst point of the Covid crisis, the leveraged fund would have seen the investor make a 50% loss on his 1999 investment at its worst point.

However, the main emphasis here is not the shock value of losing a large chunk of one's investment. That is to be expected in the short-medium term for leveraged funds. The real point is that one's investment might be potentially be locked-in for 2 decades or longer if the money is put in at the wrong point - ie leveraged funds magnify the importance of timing. The market exuberance of the past decade was not enough to save a poorly made investment in the 90s.

Nevertheless, this conundrum can be solved by a consistent dollar-cost-averaging (DCA) strategy to ensure an investor never gets caught with his ETF trousers down. If an investor invested regularly, only a minor portion of his funds would have been invested at market peaks.

In [373]:
STARTING_DATE = datetime.datetime(1999,1,1)
ENDING_DATE = datetime.datetime(2020,6,19)

plot_simulation(BASE_VALUE,dataset,STARTING_DATE,ENDING_DATE,"Comparison of returns between S&P 500 and simulated SPXL, 1999-2020")

Were the late 90s/early 2000s uniquely bad for an investor? Has it happened again since?

Just to illustrate that the results of buying in 1999 are not a one-off occurence - if an investor had invested in 2007, as the market looked promising and strong, the investor would not catch up with the base S&P 500 until 10 years later, which, although better than buying in the late 90s, is still a bad outcome. However, investing just 2 years later in early 2009 would have resulted in outsized returns - once again illustrating how crucial timing is to an investor in leveraged ETFs

In [374]:
STARTING_DATE = datetime.datetime(2007,1,1)
ENDING_DATE = datetime.datetime(2020,6,19)

plot_simulation(BASE_VALUE,dataset,STARTING_DATE,ENDING_DATE,"Comparison of returns between S&P 500 and simulated SPXL, 2007-2020")
In [375]:
STARTING_DATE = datetime.datetime(2009,1,1)
ENDING_DATE = datetime.datetime(2020,6,19)

plot_simulation(BASE_VALUE,dataset,STARTING_DATE,ENDING_DATE,"Comparison of returns between S&P 500 and simulated SPXL, 2009-2020")

Volatility

As briefly mentioned earlier, it has been suggested that volatility is the achilles' heel of leveraged ETFs. What would happen if the long term volatility of the markets increased significantly due to an evolving world order? In the nearer term, what if Covid continues to precipitate large rises and falls in the markets as investors attempt to wrestle with the implications of a prolonged global pandemic? Would a leveraged ETF still be of choice?

What is done below can be described as follows: When the S&P falls, we take it's closing price, and reduce it further by a factor which we term the volatility factor. Similarly, when it rises, we take it's closing price, and increase it further by the volatility factor. For example, if the S&P had fallen from 100 points to 95 points, and the volatillity factor is 0.01, we subtract a further 95x0.01 = 0.95 from the closing price, resulting in a closing price of 94.05. Conversely, if it rose from 100 to 105, we add a further 105x0.01 = 1.05 to the closing price, resulting in a closing price of 106.05.

The result of this process is a S&P time series that has approximately the same starting and ending values as the original dataset, but with more volatility day to day.

This will become clearer once the reader sees the graph below

In [395]:
# Set a volatility factor of 0.005 - ie, 0.5% more change per day than the original index
VOLATILITY_FACTOR = 0.005
In [340]:
def add_volatility(dataset, volatility):
    df = dataset.copy()
    
    close_values = df["Close"]
    return_percentages = df["return_percentage"]
    
    volatile_data = []
    
    for i, percentage in enumerate(return_percentages):
        close_value = close_values[i]
        
        if percentage < 0:
            volatile_data.append(close_value*(1-volatility))
        else:
            volatile_data.append(close_value*(1+volatility))
            
    df["volatile_close"] = volatile_data
    return df
In [396]:
volatile_dataset = add_volatility(dataset,VOLATILITY_FACTOR)
volatile_dataset = set_return_percentages(volatile_dataset,"volatile_close")
In [397]:
_ = pd.DataFrame({"S&P 500" : volatile_dataset["Close"], "More volatile S&P 500": volatile_dataset["volatile_close"]}).plot(figsize=(8,6),title="Volatile and original S&P 500 are indistinguishable in final returns")

As can be seen above, the original S&P 500 index and the volatile-ised S&P 500 index is virtually indistinguishable in the long term. But how does this affect the leveraged ETF?

Volatile world simulation

In a more volatile world, the returns of the simulated SPXL would trail that of the S&P500 after 40 years, and the $100 that turned into $100,000 doesn't materialise, even at the fund's peak in the late 1990s. Crucially, the ETF does not necessarily trend upwards in the long term. The point here is that if volatility in markets were to increase over the longer term, an investor would expect to earn more by buying a non leveraged fund.

In [399]:
STARTING_DATE = datetime.datetime(1978,1,4)
ENDING_DATE = datetime.datetime(2020,6,19)

plot_simulation(BASE_VALUE, volatile_dataset, STARTING_DATE, ENDING_DATE, "Comparison of returns between more volatile S&P 500 and simulated SPXL, 1978-2020")

The situation looks even more bleak if the volatility factor were to be increased to 0.01

In [400]:
VOLATILITY_FACTOR = 0.01

volatile_dataset = add_volatility(dataset,VOLATILITY_FACTOR)
volatile_dataset = set_return_percentages(volatile_dataset,"volatile_close")

STARTING_DATE = datetime.datetime(1978,1,4)
ENDING_DATE = datetime.datetime(2020,6,19)

plot_simulation(BASE_VALUE, volatile_dataset, STARTING_DATE, ENDING_DATE, "Comparison of returns between more volatile S&P 500 and simulated SPXL, 1978-2020")

Is such a change in volatility likely, or even possible?

The obvious followup question to the above analysis is if it is possible for long-term volatility in the stock markets to change. A 0.005 volatility factor corresponds to 0.5% larger daily fluctuations in index values. Gains/losses of 2-3% are common for index ETFs, so an additional 0.5% on top of this 2 - 3% is not unthinkable - we see gains/losses of 2.5 - 3.5% quite commonly.

A key assumption we are making in this analysis is that volatility and final returns are independent of each other. In practice this may not be the case. For example, larger fluctuations in the index might attract more day traders and drive away some institutional investors who seek stability. This change in demand will inevitably have an impact on the returns of the underlying index. Will increased volatility also result in increased growth that cancels out the negative effects that volatility has on leveraged ETFs? That needs to be further explored.

Conclusion

This analysis has sought to illustrate to the reader the immense importance of good timing when purchasing leveraged ETFs, and also the detrimental impact that volatility has on leveraged ETF returns. While any stock investor will have in his mind that the stock market will trend upwards over the long term, it is the twists and turns (or more accurately the ups and downs) that the leveraged ETF takes to get there that will decide the investment return of a leveraged ETF investor.

It is however, for the reader to determine if a fundamental increase in average volatility will happen over the long term. 2020 certainly looks like an uncertain and volatile year. The US-centric world order does seem to be shifting, and this certainly has ramifications on the US markets (where most of the world's leveraged ETFs are found). If it does, then the warnings of the pundits certainly are to be heeded, if not thoroughly considered - the leveraged ETF may not necessarily be as sublime a long term investment instrument as it initially makes out to be.

Wai Lun
20 June 2020

In [ ]: