Home » Posts » Varsity » Could Trend-Following Be A Successful Trading Strategy? (Part I)

Could Trend-Following Be A Successful Trading Strategy? (Part I)

October 28, 2024

Since the dawn of time, traders have been trying to find ways in which they can get returns in excess of the risk they take. One of the first such methods is trend following and it remains popular to this day. In the US, trend following funds called CTAs (Commodity Trading Advisors) have about $350 billion in AUM. In India, trend following is probably the first thing an aspiring newbie trader learns. 

The simplest construction of a trend-following strategy is to take the moving average (SMA, for Simple Moving Average) of closing prices over a certain period of time (the “window”) and take a position based on whether the current price is above or below that average. So, the only decision to be made here is the width of the window. 

We begin by testing a bunch of these widths (lookbacks) on a limited NIFTY 50 TR dataset (1999 through 2013). We ignore transaction costs and only go long.

As it turns out, no matter which lookback you chose during this period, you beat buy & hold. 

Let’s layer in transaction costs of 25bps on notional and see if it holds up.

Here, we see how small windows crash and burn in the light of transaction costs. 

Lesson #1: Always model transaction costs!

Looks like 20 through 50-day windows end up outperforming buy & hold. Now, let’s see what happens if you load up the data from 2014 through 2019.

As expected, short lookbacks hurt performance. However, the longer windows posted less than half the returns of buy & hold. Let’s zoom into the 50-day window for clarity.

Not only did the returns underwhelm, but trend-following did not even protect you from drawdowns!

Lesson #2: Always have a Train, Validate, and Test dataset. 

We can try using leverage to boost returns here. However, the 20% drawdown means that, at best, you can use 2x leverage. With 2x, you are still not beating buy & hold in the Validation data set.

Intuitively, any “one” price is choppy. Comparing a single price to its SMA could be causing too many whipsaws. What if we use a 5-day SMA for comparison instead?

Using a 5×50 with 2x leverage brings us over the hill, so to speak. However, how did this perform in our previous (Training) dataset (2014 through 2019)?

It underperformed the basic 50-day trend follow but 2x leverage would push you above 20% annualized. Not bad. Now, let’s bring out the post-COVID dataset and see how the 5×50 performed.

Not bad at all!

To understand the underlying data, you can simply plot the next-day returns vs. the difference between the 5-day and 50-day MA values with and without applying the trend-following rules.

This is buy & hold:

This is with 5×50 trend follow:

What we have described so far is a discrete process. You are either all-in or all-out based on two lookbacks. Also, the lookbacks we tested were pulled out at random. However, if “trend” largely works, why not run multiple trends?

Lookback windows going from 5 through 100 in 5-step increments (20 lookbacks). If the price is above one such window, then buy 1/20th of the NIFTY. You have either zero positions (price is below all 20 windows) through “full” (price is above all 20 windows).

Performs better than 5×50 on the Training set.

Not so much on the Validation set.

Underperforms on the Test set.

Lesson #3: Simple beats Complex!

Finally, a 5×50 trend-following strategy on the NIFTY 50 TR, including transaction costs on the entire dataset.



Founder, StockViz


Post a comment