{adamcoding}
Part III
11
Chapter 11

Trend Following

The effect

Asset returns exhibit positive autocorrelation at horizons of roughly one to twelve months. Instruments that have gone up continue up more often than chance; instruments that have gone down continue down.

Two distinct forms, frequently conflated:

Cross-sectional momentum - rank a universe by past return, go long the top decile and short the bottom. The effect is relative; it doesn't care whether the market as a whole rises.

Time-series momentum (also called absolute momentum) - go long instruments with positive past return, short those with negative, each judged against itself. This is what managed futures funds run, and it's the version that produces the distinctive crisis behaviour discussed below.

The evidence

This is the most heavily documented anomaly in finance, and it's worth knowing the primary sources rather than the folklore:

  • Jegadeesh and Titman (1993), Returns to Buying Winners and Selling Losers, established cross-sectional momentum in US equities at 3-12 month horizons. It has been replicated across international equity markets, and it is one of relatively few anomalies that survived the replication crisis reasonably intact.
  • Moskowitz, Ooi and Pedersen (2012), Time Series Momentum, documented the absolute-momentum version across 58 futures markets spanning equities, bonds, currencies and commodities.
  • Hurst, Ooi and Pedersen, A Century of Evidence on Trend-Following Investing (AQR), extended the analysis back over a century and across market regimes.

Two honest caveats. First, momentum has performed noticeably worse in the post-publication period than in the sample periods of the original papers - consistent with either decay or ordinary variance, and it is genuinely hard to distinguish those. Second, cross-sectional momentum exhibits momentum crashes (Daniel and Moskowitz): severe losses during sharp market rebounds following a decline, when the short book of beaten-down stocks rallies violently.

The mechanism

Several candidate explanations, not mutually exclusive. This matters because the mechanism tells you when the effect should fail.

Under-reaction to information. News diffuses gradually. Analysts anchor on prior estimates and revise slowly; investors are slow to update. Price converges toward fair value over weeks rather than instantly.

The disposition effect. Investors sell winners too early and hold losers too long - a robust behavioural finding. This creates artificial resistance to upward moves that eventually gives way, extending the move.

Herding and positive feedback. Trend-following flows are themselves a mechanism. Risk-parity funds, volatility-targeting mandates, and stop-loss-driven selling all mechanically buy strength and sell weakness. This is genuinely reflexive: the strategy works partly because other people run it.

Risk transfer. In commodity futures, producers hedge by selling forward. Speculators absorbing that hedging pressure earn a premium (the Keynesian normal backwardation argument). This is compensation for risk-bearing rather than an inefficiency.

Note that the second and third mechanisms are behavioural or structural - they depend on human wiring and institutional mandates rather than on information nobody has noticed. That's why the effect has been durable despite forty years of publication.

The payoff distribution

This is what people get wrong emotionally, and it is the reason most retail traders cannot run trend following even when it works.

  • Win rate of roughly 30-40%. You lose most trades.
  • Strong positive skew. A small number of large winners carry the entire result. Remove the top 5% of trades and the strategy is typically negative.
  • Long flat or losing periods. Multi-year drawdowns are normal, not pathological.
  • Convexity. Fung and Hsieh (2001) showed that trend-follower returns resemble a portfolio of lookback straddles - the payoff profile of a long option position. You pay a steady premium in choppy markets and get paid in sustained moves.

That last point is the deepest structural fact about trend following. You are structurally long optionality, which means you are paying for it in most periods. If you cannot tolerate paying insurance premiums for two years to collect in the third, you cannot run this strategy, and the fact that it's profitable in expectation will not help you.

The corollary is crisis alpha: trend following historically performs well during prolonged crises (2000-2002, 2008) because sustained moves are its payoff. It performs badly during sharp reversals (early 2020, 2009 rebound) because the reversal happens faster than the signal can turn.

Implementation

The signal choice matters far less than beginners assume. Moving-average crossovers, Donchian breakouts, the sign of the past twelve-month return, and MACD variants are all highly correlated - typically 0.8+ with each other when run on the same universe at similar speeds. Debating 13/21 versus 20/50 is close to a waste of time.

What actually drives results, in rough order of importance:

  1. Universe diversification. This is by a wide margin the largest lever. Trend following on fifty uncorrelated futures markets is a fundamentally different strategy from trend following on one instrument, because the positive skew needs many independent bets to express itself. This is also why retail trend following usually fails - running it on a single instrument gives you the payoff profile without the diversification that makes it survivable.
  2. Speed. Faster signals mean more trades, more cost, and more sensitivity to noise. Slower signals mean fewer, larger bets and longer drawdowns. Faster trend following has decayed more than slow.
  3. Volatility scaling. Sizing each position inversely to its volatility so that every market contributes comparable risk.
  4. Cost control. With turnover this high, costs compound.

A minimal but structurally correct implementation:

python
import numpy as np
import pandas as pd


def ewma_trend_signal(prices: pd.DataFrame, fast: int, slow: int) -> pd.DataFrame:
    """
    Volatility-normalised EWMA crossover, following the construction used in
    most managed-futures implementations. Normalising by volatility makes the
    signal comparable across instruments with different price scales.
    """
    fast_ewma = prices.ewm(span=fast, min_periods=slow).mean()
    slow_ewma = prices.ewm(span=slow, min_periods=slow).mean()
    raw = fast_ewma - slow_ewma

    daily_vol = prices.diff().ewm(span=36, min_periods=36).std()
    normalised = raw / daily_vol
    return normalised.clip(-2.0, 2.0)  # cap to limit single-market dominance


def volatility_scaled_positions(
    signal: pd.DataFrame,
    prices: pd.DataFrame,
    capital: float,
    target_annual_vol: float = 0.20,
    n_instruments: int | None = None,
) -> pd.DataFrame:
    """
    Convert signals into position sizes such that each instrument contributes
    comparable risk and the portfolio targets a fixed annualised volatility.
    """
    n = n_instruments or signal.shape[1]
    daily_vol_pct = prices.pct_change().ewm(span=36, min_periods=36).std()

    # Per-instrument capital allocation, then scale to hit the vol target
    per_instrument_capital = capital / n
    target_daily_vol = target_annual_vol / np.sqrt(252)

    notional = (
        signal
        * per_instrument_capital
        * (target_daily_vol / daily_vol_pct.replace(0, np.nan))
    )
    return (notional / prices).replace([np.inf, -np.inf], np.nan).fillna(0)

Two things to note about this code. The signal is normalised by volatility before use, which is what makes a single set of parameters work across instruments with wildly different price scales and volatilities. And the position sizing targets portfolio volatility rather than fixed notional, which is the standard construction and materially changes the drawdown profile.

The signals must then be lagged before being applied to returns - computing a signal from today's close and applying it to today's return is the lookahead bug from Chapter 7, and in a vectorised implementation like this it is one line away at all times.

How it kills you

  • Insufficient diversification. The positive skew requires many independent bets. Trend following on three correlated instruments is a lottery ticket.
  • Impatience. Multi-year drawdowns are normal. Most people abandon during them, converting a working strategy into a realised loss.
  • Whipsaw in ranging markets. Structural, not fixable. It's the premium you pay for the convexity.
  • Over-tuning the signal. The lowest-value place to spend degrees of freedom, and the most tempting.
  • Sharp reversals. Fast V-shaped recoveries are the specific regime this strategy cannot handle.