Trend Following Strategy: Mathematical Formulation & Implementation
Capturing multi-month price trends through dual moving average crossovers, Average True Range volatility sizing, and trailing Chandelier stops.
Key Takeaways for Investors & Traders
Built upon foundational CTA research: cut losses short, let winning trades run, and adapt to secular price drift.
Utilizes Fast (50-day) and Slow (200-day) moving average crossovers confirmed by intraday 15m trend alignments.
Ratchet stop levels using multi-period Average True Range (ATR) to lock in accumulated profits while allowing market noise.
Historically provides valuable tail-risk diversification during prolonged bear markets and macroeconomic dislocations.
Executive Summary
The Trend Following strategy identifies and exploits persistent directional price trends across intermediate and secular horizons. Using moving average crossovers, Donchian channel breakouts, and volatility-based trailing stops, the model maintains exposure to winning trends while systematically cutting underperforming positions.
Introduction, History & Economic Hypothesis
Historical Background
Trend Following is one of the oldest systematic trading philosophies, popularized by Richard Donchian in the 1960s with his 4-week rule, and later expanded by John W. Henry and the legendary Turtle Traders in the 1980s. Extensive modern research by AQR Capital Management ("A Century of Evidence on Trend-Following Investing", 2017) demonstrated consistent positive performance across global equities, bonds, currencies, and commodities over more than 100 years.
Economic Mechanism
Markets do not instantaneously adjust to new macroeconomic fundamentals. Structural economic trends—such as technological shifts, demographic changes, or multi-year interest rate cycles—unfold gradually over quarters and years. Trend Following models systematically capture this persistent price drift without attempting to forecast macroeconomic outcomes.
Strengths & Limitations
- Strengths: Generates positive skewness (large outlier wins compensating for frequent small losses); acts as an effective portfolio hedge during prolonged equity bear markets ("crisis alpha").
- Limitations: Low overall win rates (typically 35% to 45%); experiences multi-month drawdown periods during choppy, range-bound consolidation regimes.
Mathematical Foundation
The Trend Following model combines multiple mathematical indicators:
1. Moving Average Trend Crossover
The primary directional filter utilizes Fast ($N_{\text{fast}} = 50$) and Slow ($N_{\text{slow}} = 200$) Simple Moving Averages:
$$\text{SMA}_{\text{fast}}(t) = \frac{1}{N_{\text{fast}}} \sum_{i=0}^{N_{\text{fast}}-1} P_{t-i}, \quad \text{SMA}_{\text{slow}}(t) = \frac{1}{N_{\text{slow}}} \sum_{i=0}^{N_{\text{slow}}-1} P_{t-i}$$
For the standard institutional configuration ($N_{\text{fast}} = 50$, $N_{\text{slow}} = 200$):
$$\text{SMA}_{50}(t) = \frac{1}{50} \sum_{i=0}^{49} P_{t-i}, \quad \text{SMA}_{200}(t) = \frac{1}{200} \sum_{i=0}^{199} P_{t-i}$$
The percentage moving average spread measures trend intensity:
$$\text{Spread}_{\text{MA}, t} = \frac{\text{SMA}_{\text{fast}}(t) - \text{SMA}_{\text{slow}}(t)}{\text{SMA}_{\text{slow}}(t)}$$
2. Average True Range (ATR)
Volatility is quantified using J. Welles Wilder's True Range (TR) and 14-period ATR:
$$\text{TR}_t = \max(H_t - L_t, |H_t - C_{t-1}|, |L_t - C_{t-1}|)$$
$$\text{ATR}_t = \frac{\text{ATR}_{t-1} \cdot 13 + \text{TR}_t}{14}$$
3. Chandelier Volatility Trailing Stop
To protect unrealized gains without exiting on normal volatility noise, a Chandelier stop ratchets upward behind the highest high ($HH_M$) over the past $M = 22$ trading days:
$$\text{Stop}_{\text{long}} = \text{Stop}_{\text{long}, t} = \max_{k \in [0, M-1]} (H_{t-k}) - m \cdot \text{ATR}_t \quad (m = 2.5)$$
Implementation & Signal Logic
The strategy generates signals based on crossover conditions confirmed by volatility stops:
graph TD
A[Calculate 50-day & 200-day SMAs and 14-day ATR] --> B{Crossover Condition}
B -->|Golden Cross: SMA50 > SMA200| C[LONG Signal: +1.0]
B -->|Death Cross: SMA50 < SMA200| D[SHORT or FLAT Signal: -1.0 / 0.0]
C --> E[Initialize Chandelier Trailing Stop: HH22 - 2.5 x ATR]
E --> F{Stop Violation Check}
F -->|Close < Stop_long| G[Exit Trade: Trailing Stop Triggered]
F -->|Close >= Stop_long| H[Maintain Position: Ratchet Stop Upward]
Execution Directives
- Golden Cross Long Entry (
+1.0): Triggered when $\text{SMA}_{\text{fast}}$ crosses above $\text{SMA}_{\text{slow}}$, confirmed by closing price $P_t > \text{SMA}_{\text{fast}}$. - Death Cross Exit / Short (
-1.0or0.0): Triggered when $\text{SMA}_{\text{fast}}$ crosses below $\text{SMA}_{\text{slow}}$. - Chandelier Trailing Exit: If the closing price falls below the current ratcheted stop ($\text{Close}_t < \text{Stop}_{\text{long}, t}$), the position is liquidated immediately at market open, overriding the moving average crossover.
Practical Trader & Operational Considerations
- Psychological Discipline: Because trend following strategies typically endure win rates between 35% and 45%, traders must maintain emotional discipline to endure consecutive small losses while waiting for outsized trend payoffs.
- Whipsaw Mitigation: Applying a multi-timeframe 15-minute EMA confirmation filter significantly filters out false crossovers that occur during sideways consolidations.
- Position Sizing by Risk: Capital allocation is inversely proportional to ATR ($W_i \propto \frac{1}{\text{ATR}_i}$), equalizing dollar risk across volatile and conservative assets.