Back to all posts

Mean Reversion vs Trend Following: Which Strategy Wins?

Compare mean reversion and trend following strategies. Learn when to use each approach and how to combine them for better trading results.

SpendDock Team··4 min read
Trading StrategyMean ReversionTrend FollowingTechnical Analysis

Two dominant philosophies drive most trading strategies: mean reversion and trend following. Understanding when to use each approach can dramatically improve your trading results.

What is Mean Reversion?

Mean reversion strategies assume that prices eventually return to their average. When price deviates significantly from its mean, it's likely to reverse.

Core principle: "What goes up must come down"

Common indicators:

  • RSI (overbought/oversold)
  • Bollinger Bands (price at bands)
  • Standard deviation channels
  • Z-score

Example strategy:

pinescript
//@version=5
strategy("Mean Reversion", overlay=true)

// Bollinger Bands
length = input(20, "BB Length")
mult = input(2.0, "BB Multiplier")
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upper = basis + dev
lower = basis - dev

// RSI
rsiValue = ta.rsi(close, 14)

// Buy at lower band when oversold
longCondition = close <= lower and rsiValue < 30
if (longCondition)
    strategy.entry("Long", strategy.long)

// Exit at middle band
if (close >= basis)
    strategy.close("Long")

plot(basis, "Basis", color=color.blue)
plot(upper, "Upper", color=color.red)
plot(lower, "Lower", color=color.green)

What is Trend Following?

Trend following strategies assume that prices in motion tend to stay in motion. You ride the trend until it reverses.

Core principle: "The trend is your friend"

Common indicators:

  • Moving average crossovers (EMA 20/50)
  • MACD
  • ADX (trend strength)
  • Donchian channels

Example strategy:

pinescript
//@version=5
strategy("Trend Following", overlay=true)

// EMAs
fastEMA = ta.ema(close, 20)
slowEMA = ta.ema(close, 50)

// Buy on golden cross
longCondition = ta.crossover(fastEMA, slowEMA)
if (longCondition)
    strategy.entry("Long", strategy.long)

// Sell on death cross
shortCondition = ta.crossunder(fastEMA, slowEMA)
if (shortCondition)
    strategy.close("Long")

plot(fastEMA, "Fast EMA", color=color.green)
plot(slowEMA, "Slow EMA", color=color.red)

Head-to-Head Comparison

FactorMean ReversionTrend Following
Win rateHigher (60-70%)Lower (30-40%)
Risk/rewardLower (1:1)Higher (3:1+)
Best marketRanging/sidewaysTrending
Worst marketStrong trendsChoppy/ranging
Hold timeShort (hours-days)Long (days-weeks)
DrawdownsFrequent, smallRare, large

When to Use Each Strategy

Use Mean Reversion When:

  • Market is range-bound (ADX < 25)
  • High volatility with no clear direction
  • Trading forex pairs with strong correlations
  • Shorter timeframes (intraday)

Use Trend Following When:

  • Market has clear direction (ADX > 25)
  • Major news events create momentum
  • Trading commodities or crypto
  • Longer timeframes (daily/weekly)

The ADX Filter

Use ADX (Average Directional Index) to determine which strategy to apply:

pinescript
//@version=5
strategy("Adaptive Strategy", overlay=true)

// ADX for trend strength
adxLength = input(14, "ADX Length")
adxValue = ta.adx(high, low, close, adxLength)
adxThreshold = input(25, "ADX Threshold")

// Trend indicators
fastEMA = ta.ema(close, 20)
slowEMA = ta.ema(close, 50)

// Mean reversion indicators
rsiValue = ta.rsi(close, 14)
bbLower = ta.sma(close, 20) - 2 * ta.stdev(close, 20)

isTrending = adxValue > adxThreshold

// Trend following when ADX > 25
if (isTrending and ta.crossover(fastEMA, slowEMA))
    strategy.entry("Trend Long", strategy.long)

// Mean reversion when ADX < 25
if (not isTrending and close < bbLower and rsiValue < 30)
    strategy.entry("MR Long", strategy.long)

// Exits
if (isTrending and ta.crossunder(fastEMA, slowEMA))
    strategy.close("Trend Long")
if (not isTrending and rsiValue > 70)
    strategy.close("MR Long")

Hybrid Approach: Best of Both Worlds

Many successful traders combine both strategies:

  1. Identify the trend (trend following)
  2. Enter on pullbacks (mean reversion)
pinescript
//@version=5
strategy("Hybrid Strategy", overlay=true)

// Trend: Price above 200 EMA
ema200 = ta.ema(close, 200)
uptrend = close > ema200

// Pullback: RSI oversold
rsiValue = ta.rsi(close, 14)
pullback = rsiValue < 40

// Entry: Uptrend + Pullback
longCondition = uptrend and ta.crossover(rsiValue, 40)
if (longCondition)
    strategy.entry("Long", strategy.long)

// Exit: RSI overbought or trend break
if (rsiValue > 70 or close < ema200)
    strategy.close("Long")

plot(ema200, "EMA 200", color=color.yellow)

Backtest Results

Historical performance comparison (S&P 500, 2015-2025):

StrategyAnnual ReturnMax DrawdownSharpe Ratio
Mean Reversion (RSI)12.3%-18%0.85
Trend Following (EMA)14.7%-24%0.72
Hybrid16.2%-15%1.05

The hybrid approach often produces the best risk-adjusted returns.

Key Takeaways

  1. No single strategy works in all markets — adapt to conditions
  2. Mean reversion wins more often but with smaller profits
  3. Trend following wins less often but with larger profits
  4. Use ADX to identify which regime you're in
  5. Hybrid strategies can capture the best of both worlds

Build Your Strategy with SpendDock

Describe your strategy in plain English:

"Create a hybrid strategy that buys when price is above 200 EMA and RSI drops below 35. Use ATR for stop loss and exit when RSI reaches 65."

SpendDock generates code for TradingView, MetaTrader, NinjaTrader, or Python — no coding required.

Skip the Coding — Generate Your Strategy

Describe your trading strategy in plain English and get production-ready code for TradingView, MetaTrader, NinjaTrader, or Python.

Try SpendDock Free