Tag: trend following

Strategy 9

In Rob Carver’s Advanced Futures Trading Strategies (Amazon,) there’s a chapter, “Strategy Nine: Multiple Trend Following Rules,” that uses composite trend-following rules to drive a long-short strategy. We explore the strategy through an Indian market participant’s lens.

There are a number of decision points to navigate. Primarily, long-only vs. long-short, binary vs. scaled and equal-weight vs. cost-screen. Some of these are not practical for retail futures traders. For example, you could use the different SMA rules to scale in and out of positions instead of taking a binary approach. However, that implies that each position will need at least a dozen contracts – a capital requirement that is out of reach of a typical retail trader. Another problem is that the Indian market is notoriously expensive to trade. The cost-screen used by Carver throws out a lot of short-term SMAs, making the strategy unresponsive to short-term market moves.

Summarizing NIFTY 50, NIFTY BANK, NIFTY MIDCAP and SMALLCAP indices through Strategy 9:

NIFTY 50 and NIFTY BANK are poor candidates for this system – consistently under-performing buy & hold. The SMALLCAP index doesn’t have futures listed on it – forcing a realistic implementation to be long-only. The MIDCAP index does have futures on it, making long-short possible. The cost-screen version can be safely ignored.

If we decide to use futures for MIDCAP, we need to make sure we don’t blow up because of leverage. The problem with the long-short strategy is the periodic 20% drawdowns. Even at 2x leverage, that’s a capital impairment of over 40%.

However, looking at the equity curve, it may be worth the extra antacid budget?

The next question is, scaled vs. binary?

The scaled long-short version (red line in the chart above) is objectively worse than binary long-short (green line).

So, the version that worked for MIDCAPs is a binary long-short without cost-screen.

For SMALLCAP, given that it doesn’t have listed futures, we’ll have to settle for the binary long-only version without cost-screen.

We interrogated Claude as to the robustness of Carver’s approach. You can read the back-and-forth here.

Code and charts on github.

Simple Trend-following

Our introduction to trend-following posts on Zerodha Varsity (Part I, II, III, IV and V) used tradfi instruments to build a basic model. What if we applied the same principles on crypto assets?

To keep things simple, we’ll pick only two assets: BTC and ETH. The portfolio is evenly split between the two. Since crypto markets are 24/7/365, we’ll divide each day into 24 hour slots and construct a daily series based on the closing prices at each hour. The portfolio is further split into 24 parts each. Each position is an average of a binary trend signal.

Individually, trend-following boosts the Sharpe ratio of each asset.

You may not have captured the absolute highs but you would have avoided the steep drawdowns.

They are stronger together than individually.

Needless to say, leverage in this scenario would be fatal.

Code on github.

Trends with (No) Benefits

It is easier to work with core strategies that fall into one of these extremes:

  1. low volatility / low max-drawdown that can be levered to achieve higher returns without blowing up, or
  2. high volatility / high max-drawdown and high returns that can be managed through asset-allocation and rebalancing.

The worst ones are those that have neither low volatility nor high returns.

Trend-following techniques deliver on (1). However, not everything trends.

Case in point are the Trendpilot ETFs PTLC over the S&P 500 (SPY) and PTNQ over the Nasdaq 100 (QQQ).

The methodology makes intuitive sense.

However, performance is a different matter.

The trend ETFs have worse Sharpe ratios than their benchmarks.

The silver lining is that the ETF versions are better than naïve trend strategies using only SMAs and would work out to be more cost and tax efficient than rolling your own.

However, the naïve versions all have Sharpe ratios less than 1.0 and high drawdowns. This tells us that the indices themselves may not amenable to trend-following and that they belong to (2) above?

Strategy design should follow the “first make it work then make it better” philosophy. If the simplest approach doesn’t work, then adding bells-and-whistles to it is unlikely to make it any better. If something is not trending, then what exactly are you following?

Code and charts are on github.

Trend Factor

Han, Yufeng and Zhou, Guofu and Zhu, Yingzi, A Trend Factor: Any Economic Gains from Using Information over Investment Horizons? (SSRN), outlines the construction of a trend factor for equities.

In this paper, we provide a trend factor that captures simultaneously all three stock price trends: the short-, intermediate-, and long-term, by exploiting information in moving average prices of various time lengths whose predictive power is justified by a proposed general equilibrium model. It outperforms substantially the well-known short-term reversal, momentum, and long-term reversal factors, which are based on the three price trends separately, by more than doubling their Sharpe ratios. 

Does the paper’s claim hold true for Indian equities? Not really.

The Long-only Trend Factor underperformed a naïve momentum strategy and its corresponding benchmark. The Long-short Trend factor returns was negative.

Even after “tuning” the look-back periods, the Trend Factor failed to beat momentum.

Constructing a portfolio of stocks using trend following seems to be a dead end. Our previous attempts at this — Dynamic Linear Model v1.0 and Dynamic Equity Trend-following — have yielded similar results as well.

Momentum beats Trend-Following.

Code and charts are on github.

Standard breakout strategy

The book Following the Trend: Diversified Managed Futures Trading, Andreas Clenow, describes a simple “breakout” strategy:

If today’s close is higher or equal to the highest close in the past 50 days, we buy tomorrow; if the close is below or equal to the lowest close for the past 50 days, we sell open tomorrow and go short. A similar logic is used to get out of positions, where a long trade is sold when the close reaches the lowest point in 25 days and a short trade is covered when the price makes a 25-day high.

The book was published more than a decade ago and traders would’ve moved on from the basic strategy it described. However, we were curious if it ever worked at all on Indian indices. So, we ran a backtest.

Turns out, it never did.

Layering a trend filter seems to help a little.

While the strategy avoids some really steep drawdowns, the backtest doesn’t consider trading costs, taxes, etc.

While you could data-mine and get to a bunch of parameters that might work for “trading breakouts”, there is no reason why it should continue to work in the future.

Code and charts for other indices are on github.