Trend Following Is SO Back. [Code Included]
It's better to be a follower, than a leader – trust me.
Over the last few weeks, we’ve stepped aside from the quirky option volatility space and have started to focus on getting a piece of more lucrative medium-frequency (MFT) strategies.
We last visited momentum trading, one of the most popular MFT strategies and revealed that despite its popularity, it is still an extremely productive approach:
However, we ran into a problem:
The profits from momentum trading come from a long/short portfolio. You buy stocks with positive momentum while shorting those with negative momentum.
However, implementing this is very costly. You often need to have at least 10-30 stocks on each side, creating a tough barrier of entry starting at $100k+ just to put on a trade.
We improvised this with a profitable approach that used options instead of shares outright, but it was still relatively expensive given the need for multiple positions:
This led us to seek out an alternative strategy where we wouldn’t need to bear with the cost of going long/short on dozens of stocks. After some deliberation, we found something.
Trend Following
Much like momentum trading, trend following is a strategy you’ve heard of before, but don’t really know exactly how it works. In further similarity, trend following is also a big business:
The Société Générale trend following index tracks the performance of hedge funds that deploy trend following strategies in futures markets. Over the past 25 years, the strategy has posted an annualized ~6% return with low correlation to the S&P 500. As we’ve discussed previously; for a hedge fund, the goal isn’t always beating the S&P 500 — it’s to remain uncorrelated and still make money at scale.
Further, at Commodity Trading Advisors (CTAs), trend following is almost always the cash cow of the operation.
So, now that we know the big boys are still hauling away cash with these strategies — it’s time for us to get a piece of the pie.
However, before diving any deeper, we first need to define and understand what trend following is and what phenomenon it tries to capture. To do this, we’ll enlist the help of our friends in academia.
The hallmark paper on trend following is Mebane Faber’s “A Quantitative Approach to Tactical Asset Allocation”. The big picture idea of the paper is that even from the 19th century, a simple trend following approach has led to outperformance in every asset class:
However, that’s not the interesting part. What’s interesting is how a trend is defined:
The author defines a positive trend as when the price increases above the 200-day moving average, and a negative trend as when the price falls below it. This is surprising, especially from a quantitative perspective where the common assumption is that such strategies are akin to “astrology for men”.
However, it seems that almost universally, this is the approach used by trend following programs. In a different paper, the authors deploy the same approach but with moving averages of different timescales and still generate comparable results:
Even more papers: A Century of Evidence on Trend-Following Investing (AQR), Does Trend Following Work on Stocks? (UPenn)
Now, these strategies aren’t “they just work” strategies, they actually have a pretty solid economic intuition that roots from behavioral finance:
Herding: After markets have trended, some traders jump on the bandwagon, and thus prolonging the herding effect and trends.
Confirmation Bias: People tend to look for information that confirm their views and beliefs. This can lead investors to buy assets that have recently made money, and sell assets that have declined, causing trends to continue.
So, now that we understand how trend following is generally defined and why it works, let’s dive into some experiments of our own.
Could It Really Be That Simple?
We’re starting from a place of skepticism due to our prejudice to such strategies, so naturally, we turn to some hard data.
To begin, we will create our own trend following criteria:
if the 3-month moving average price > 6-month moving average price → BUY
if the 3-month moving average price < 6-month moving average price → SELL
Here’s what that looks like in data form:
Pictured is a dataframe of CBOE’s stock prices and a column, “regime”, which tells us if the stock is currently in a positive trend or a negative trend. As demonstrated, when the regime changes to 1, it indicates that the stock is no longer in a down trend and acts as our buy signal.
Without getting too far ahead of ourselves, regime classification has been a problem we’ve been trying to solve for awhile now. Being able to say “x market is in a y regime” or “x strategy performs best in y regimes” is extremely useful. So, we’ll be coming back to this regime classification concept later.
Nevertheless, here’s a visual representation:
Our approach declares CBOE’s stock to have been in a positive trend since August 15th, 2022 and buying upon that signal seems to have worked pretty well. You can also visually refer to declarations of negative trends (3m < 6m) and subsequent price performance.
While we’re off to an interesting start, this is just one stock — let’s see if this works across hundreds.
To explore this, we’ll track the returns of making trades upon regime shifts. So, if a stock enters a negative regime, we short it until it enters a positive regime and vice versa.
If today, the 3-month average price fell below the 6-month average price, we initiate a short position and hold it until the 3-month average price rises above the 6-month average price
We don’t used box plots often, so here’s a diagram of how it works:
As demonstrated, across ~400 stocks from 2021, taking the buy signals generated significantly higher average and outlier positive returns, with the short signals generating lower average returns and stronger outliers of negative returns.
Let’s look at a sample of trades taken for a ticker, QQQ:
The date column represents when the regime changed, acting as our signal to long/short. So, in row 1 we got the buy signal for QQQ and held for 415 days for an ~8% return. When that regime ended on 02/22 (~ invasion of Ukraine), we went short QQQ for 359 days for an ~11% return.
With an average holding period of ~233 days (for QQQ), this strategy is definitely in the low/medium frequency range, but nevertheless — it works. Not only does it work, but it doesn’t require the capital needed for a heavy long/short approach, nor do you need to deal with complex execution management.
So, now that we have a reasonable basis to assume that the trend following approach works, what if we got creative and applied it on our own?