Systematic Trading
300Hours Learn Lab Curriculum Reading | Topic: CAIA1_HEDGE | Qualification: CAIA LEVEL1
## Systematic Trading Rules and Market Price Behavior **Systematic trading** converts investment hypotheses into explicit, fully specified quantitative algorithms that govern market entry, position sizing, exit timing, and risk limits without discretionary human overrides. Systematic futures strategies generally test whether asset prices deviate from a pure **random walk**-a statistical process in which tomorrow's price change is completely independent of historical price movements, rendering purely technical trading unprofitable after transaction costs. When markets depart from a random walk, systematic rules target two opposite behavioral and structural patterns: - **Trend-Following Strategies (Momentum)**: Exploit positive serial correlation when prices adjust gradually to macroeconomic shocks, central bank cycles, or supply disruptions. Driven by investor anchoring, slow institutional rebalancing, and herding, sustained trends allow systematic systems to buy rising markets and sell falling markets. - **Mean-Reverting Strategies**: Exploit negative serial correlation when temporary liquidity shocks or short-term emotional overreactions push prices far away from recent equilibrium, betting on a quick snapback toward the mean. ## Three Key Questions in Evaluating a Systematic Trading System Because historical backtests can easily be engineered to look impressive on paper, institutional allocators evaluate any systematic CTA by probing **three foundational questions**: 1. **What is the economic or behavioral rationale behind the trading rule?** A credible system rests on a durable market friction-such as central bank policy inertia, commercial hedger risk transfer, or behavioral under-reaction-rather than arbitrary curve-fitted coincidences. 2. **How was the system developed, validated, and protected against overfitting?** Allocators inspect whether parameters were chosen cleanly across multiple markets and time horizons rather than cherry-picked on a single historical window. 3. **How will the system behave under live execution frictions and potential degradation?** Real-world viability depends on transaction costs, **slippage**, capacity constraints, and ongoing monitoring for alpha decay. ## Validation, Robustness, Slippage, and Degradation Rigorous **validation** separates genuine predictive signals from statistical noise: - **In-Sample Versus Out-of-Sample Data**: Quantitative researchers split historical market records into **in-sample data** (used to build and calibrate the model) and strictly untouched **out-of-sample data** (held aside to test whether the rule generalizes forward). Testing hundreds of parameter variations until an in-sample Sharpe ratio looks stellar produces *data-mining bias* that collapses in live trading. - **Robustness Testing**: A **robust** trading rule delivers stable risk-adjusted performance across neighboring parameter values (for example, 40-day, 50-day, and 60-day moving averages perform similarly) and across diverse asset classes (rates, FX, equities, commodities). Fragile systems that succeed only at an exact magic lookback window (say, 47 days) are almost certainly overfit. - **Slippage**: Backtests assume trades execute instantaneously at closing or signal prices. In live markets, **slippage**-the adverse difference between the theoretical signal price and actual realized fill price due to bid-ask spreads, latency, and market impact-erodes short-term high-turnover strategies far more severely than medium- or long-term trend systems. - **Degradation**: Even valid systematic rules experience performance **degradation** over time as rival quantitative funds discover identical signals (crowding), market microstructure changes, or macroeconomic regimes shift from trending to choppy. ```mermaid flowchart TD A[Economic Rationale: Momentum or Mean Reversion] --> B[In-Sample Model Calibration] B --> C[Out-of-Sample Validation and Parameter Robustness Test] C --> D[Live Execution Accounting for Commissions and Slippage] D --> E[Signal Performance Monitoring] E --> F[Regime Trending: Positive Trend Convexity] E --> G[Sideways Market: Whipsawing False Signals] E --> H[Alpha Degradation Audit and Research Refresh] classDef blue fill:#eff6ff,stroke:#1976D2,color:#1e293b,stroke-width:1.5px; classDef green fill:#dcfce7,stroke:#009966,color:#1e293b,stroke-width:1.5px; classDef amber fill:#fffbeb,stroke:#FFA300,color:#1e293b,stroke-width:1.5px; classDef red fill:#fef2f2,stroke:#A11E3D,color:#1e293b,stroke-width:1.5px; class A,B,C blue; class D,E,H amber; class F green; class G red; ``` ## Moving Average Strategies: SMA, WMA, and EMA **Moving averages** are the workhorse indicators of systematic trend following, smoothing noisy daily price fluctuations to reveal underlying directional drift. The CAIA curriculum tests three formulations: - **Simple Moving Average (SMA)**: Assigns equal weight ($1/N$) to the most recent $N$ closing prices. While simple and transparent, an SMA reacts slowly to sudden turning points and exhibits a "drop-off effect" when a large old observation exits the trailing window. - **Weighted Moving Average (WMA)**: Assigns linearly declining weights-giving the highest weight ($N$) to the most recent day, $N-1$ to the prior day, down to $1$ for the oldest day, divided by the sum of weights $N(N+1)/2$. A WMA responds faster to fresh price shifts than an SMA of equal length. - **Exponential Moving Average (EMA)**: Applies exponentially decaying weights to *all* past observations using a smoothing factor $\alpha = \frac{2}{N + 1}$ (or a chosen $\lambda \in (0, 1)$), updated recursively as $\text{EMA}_t = \alpha P_t + (1 - \alpha)\text{EMA}_{t-1}$. An EMA places heavier weight on recent prices while avoiding abrupt drop-off jumps. ### Worked Example: Calculating 5-Day SMA, WMA, and EMA Suppose a commodity futures contract posts the following five consecutive daily settlement prices (in USD): Day 1 = 100, Day 2 = 102, Day 3 = 104, Day 4 = 103, and Day 5 = 106. Assume the Day 4 EMA was $\text{EMA}_4 = 102.50$, and use the standard 5-day smoothing constant $\alpha = \frac{2}{5 + 1} = \frac{1}{3} \approx 0.3333$. Compute the Day 5 **SMA**, **WMA**, and **EMA**: $ \begin{aligned} \text{SMA}_5 &= \frac{100 + 102 + 104 + 103 + 106}{5} \\ \text{SMA}_5 &= \frac{515}{5} \\ \text{SMA}_5 &= \text{USD } \mathbf{103.00} \\ \text{Sum of WMA Weights} &= 1 + 2 + 3 + 4 + 5 \\ \text{Sum of WMA Weights} &= 15 \\ \text{WMA}_5 &= \frac{(1 \times 100) + (2 \times 102) + (3 \times 104) + (4 \times 103) + (5 \times 106)}{15} \\ \text{WMA}_5 &= \frac{100 + 204 + 312 + 412 + 530}{15} \\ \text{WMA}_5 &= \frac{1{,}558}{15} \\ \text{WMA}_5 &= \text{USD } \mathbf{103.87} \\ \text{EMA}_5 &= (0.3333 \times 106.00) + (0.6667 \times 102.50) \\ \text{EMA}_5 &= 35.33 + 68.33 \\ \text{EMA}_5 &= \text{USD } \mathbf{103.67} \end{aligned} $ Because prices trended upward toward USD 106 on Day 5, both the WMA (USD 103.87) and EMA (USD 103.67) track closer to the current spot price than the equal-weighted SMA (USD 103.00). ## Interpreting Moving Average Crossovers and Whipsawing In a **single moving average** system, the algorithm goes long when the market price rises above the moving average and flips short when price drops below it. In a **dual moving average crossover** system, the trader tracks a fast (short-term, e.g., 20-day) moving average alongside a slow (long-term, e.g., 100-day) moving average: - **Bullish Crossover (Long Signal)**: Fast MA crosses above Slow MA, signaling upward momentum acceleration. - **Bearish Crossover (Short Signal)**: Fast MA crosses below Slow MA, signaling downward trend reversal. The classic operational hazard of moving average systems is **whipsawing** inside a **sideways market** (range-bound choppy trading). When prices oscillate repeatedly back and forth across the moving average without establishing a sustained trend, the system is tricked into buying near short-term peaks and reversing short near short-term troughs-generating a steady sequence of small realized losses compounded by brokerage commissions and slippage. Lengthening the lookback window reduces whipsaw frequency, but increases entry lag and gives back more profit at trend reversals. ## Breakout Strategies **Breakout strategies** represent the second major family of systematic trend-following rules. Rather than comparing prices against a rolling average, a breakout rule defines an upper resistance boundary and a lower support boundary-most classically via a **Donchian Channel** (the trailing $N$-day high and trailing $N$-day low, such as 20-day or 55-day extremes) or **volatility channels** (moving average plus/minus a multiple of historical standard deviation or Average True Range): - **Long Entry**: Triggered when the current price breaks above the trailing $N$-day high. - **Short Entry**: Triggered when the current price breaks below the trailing $N$-day low. - **Exit / Stop-Loss**: Often governed by a shorter trailing channel (e.g., enter on a 50-day breakout, exit on a 20-day reverse breakout), automatically locking in trend profits while cutting losing positions promptly. | Systematic Rule Type | Core Trigger Signal | Best Market Environment | Primary Vulnerability | | :--- | :--- | :--- | :--- | | **Simple / Dual Moving Average** | Price or Fast MA crossing Slow MA | Smooth, persistent multi-month directional trends | **Whipsawing** in sideways markets; delayed reversal exits | | **Channel / Volatility Breakout** | Price exceeding trailing N-day high/low or volatility band | Sharp trend accelerations emerging from tight consolidations | False breakouts ("head fakes") and high entry slippage during spikes | | **Mean-Reversion Oscillator** | Price stretched beyond extreme statistical z-score or band | Range-bound, choppy, mean-reverting markets | Catastrophic losses during sustained unpredicted trend breakouts | By combining multiple lookback horizons (short, medium, and long-term moving averages alongside breakout rules) across dozens of uncorrelated futures contracts, institutional systematic CTAs smooth individual signal noise while preserving portfolio-level trend capture. - **Random Walk vs. Systematic Rules**: Under a pure **random walk**, price rules cannot outperform; systematic traders target persistent **momentum** (trend following) or short-term **mean-reverting** anomalies. - **Validation & Frictions**: Credible systematic models separate **in-sample data** from untouched **out-of-sample data**, test parameter **robustness**, account realistically for execution **slippage**, and monitor for alpha **degradation**. - **Moving Averages**: **SMA** weights all $N$ prices equally; **WMA** applies linearly higher weights to recent days; **EMA** applies recursive exponential smoothing ($\alpha = 2/(N+1)$) that reacts rapidly without drop-off artifacts. - **Whipsaws & Breakouts**: Moving-average crossovers and N-day **breakout strategies** thrive in sustained directional trends but suffer **whipsawing** and false breakouts during choppy **sideways markets**. What You Need to Know