DNS Research

Moving Averages and Trend Following: Building a Simple Trading System

advertisement

Moving Averages and Trend Following: Building a Simple Trading System

Moving averages are among the most widely used technical indicators in financial markets, and for good reason: they transform noisy price data into a smooth, interpretable line that reveals the underlying direction of a trend. At their core, moving averages calculate the mean price of an asset over a defined lookback period, updating continuously as new data arrives. A 50-day simple moving average (SMA), for instance, adds the closing prices of the most recent 50 sessions and divides by 50, dropping the oldest observation each day. The result is a lagging indicator by design—it confirms trends rather than predicting them—yet this same lag is what filters out the random intraday fluctuations that derail discretionary traders. Trend following, as a discipline, rests on the empirical observation that markets exhibit persistence: assets that have been rising tend to keep rising, and assets that have been falling tend to keep falling, at least over intermediate horizons. By combining moving averages with disciplined rules, traders can construct a simple, transparent system that captures large directional moves while cutting losses when trends reverse.

Types of Moving Averages and Their Trade-offs

The simple moving average (SMA) treats every price in the lookback window equally. Its straightforwardness makes it easy to backtest and explain, but it also means a single large price spike can distort the average for the entire period until it rolls off. The exponential moving average (EMA) addresses this by applying a weighting multiplier to recent prices, giving greater influence to the latest data. The EMA responds faster to price changes, which reduces lag but increases the frequency of whipsaws—false signals that occur when price briefly crosses the average and then reverses. The weighted moving average (WMA) applies linear weights, while the smoothed moving average (SMMA, or Wilder’s smoothing) uses a recursive formula popularized in the RSI indicator. For most simple trend systems, the choice between SMA and EMA matters less than consistency: pick one, apply it uniformly across backtests and live trading, and understand its responsiveness. Short lookback periods (10–20 bars) produce responsive averages suited to swing trading; long periods (100–200 bars) define major trend regimes and serve as dynamic support or resistance.

The Core Signal: Price Versus Average

The most elementary trend-following rule is to hold a long position when price closes above a chosen moving average and to stand aside (or go short) when price closes below it. This binary filter captures the essence of trend following: participation during uptrends, avoidance during downtrends. A common implementation uses the 200-day SMA on daily charts as a regime filter—widely watched by institutional investors—and the 50-day SMA for intermediate signals. When the 50-day crosses above the 200-day, a “golden cross” occurs, often interpreted as confirmation of a bullish regime; the inverse, a “death cross,” signals bearish conditions. These crossover signals lag price action, meaning entries occur after a trend has begun and exits after it has ended. The trade-off is explicit: you sacrifice the first and last portions of every move in exchange for avoiding the choppy middle ground where false starts proliferate. Research across equities, futures, and currencies consistently shows that a small number of large trending moves account for the bulk of trend-following returns, which is why cutting losers quickly and letting winners run is non-negotiable.

Designing the System: Rules, Filters, and Position Sizing

A robust simple system specifies entry, exit, and sizing rules with zero ambiguity. Entry: go long when the close exceeds the 50-day SMA and the 50-day SMA is above the 200-day SMA (confirming alignment). Exit: close the position when price falls below the 50-day SMA or when the 50-day crosses back beneath the 200-day. Position sizing can be as simple as allocating a fixed percentage of equity per trade or as sophisticated as volatility-adjusted sizing using Average True Range (ATR), where position size equals risk budget divided by (ATR × point value). Adding a volume filter—requiring above-average volume on breakout days—reduces false signals. A time-based stop, such as exiting after 20 bars without favorable movement, frees capital from stagnant trades. Crucially, every rule must be testable: if you cannot code it into a spreadsheet or backtesting platform, it is too subjective for a systematic approach.

Backtesting, Metrics, and the Reality of Drawdowns

Backtesting a moving average system requires clean, survivorship-bias-free data and realistic assumptions about slippage and commissions. Key metrics include compound annual growth rate (CAGR), maximum drawdown, Sharpe ratio, win rate, and profit factor. Trend-following systems typically exhibit win rates below 50%—often 35–45%—because most trades produce small losses while a minority generate large gains. A profit factor above 1.5 and a maximum drawdown tolerable to the trader’s psychology are reasonable thresholds. Walk-forward analysis, where parameters are optimized on in-sample data and validated on out-of-sample data, guards against curve-fitting. Traders should also test across multiple asset classes and time frames to confirm the edge is robust rather than idiosyncratic. Expect drawdowns: even excellent trend systems endure losing streaks of ten or more trades, and the psychological discipline to execute through those periods is the true differentiator between theoretical and realized performance.

Common Pitfalls and Refinements

Over-optimization is the most seductive trap: tweaking lookback periods until backtested equity curves look flawless produces systems that fail in live markets. Resist the urge to optimize beyond a small parameter grid. Another pitfall is ignoring market regime changes—moving average systems whipsaw in range-bound markets, so some traders add an ADX filter (requiring ADX above 20–25) to confirm trending conditions before taking signals. Combining two time frames, such as a daily signal filtered by a weekly trend, reduces noise at the cost of fewer trades. Finally, transaction costs compound: high-frequency crossover systems on short time frames can see edges eroded entirely by spreads and commissions, making daily or weekly bars preferable for most retail traders.

Execution and Ongoing Maintenance

Once live, the system demands operational discipline: predefined position sizes, logged trades, and scheduled reviews (monthly or quarterly) rather than reactive tinkering after every loss. Keep a trading journal documenting entry rationale, exit rationale, and emotional state. Monitor rolling performance metrics against backtest expectations; a sustained deviation signals either regime change or system decay. Automate signals where possible using platforms like TradingView, MetaTrader, or Python libraries such as pandas and backtrader, but retain manual oversight for order execution. Rebalance position sizes as equity grows or shrinks. The beauty of a simple moving average trend system is its transparency—every decision traces to a rule—which makes it an ideal foundation for traders learning systematic discipline before graduating to multi-factor models.

advertisement

latest posts

Something went wrong. Please refresh the page and/or try again.