← Back to Home
Trading Strategy
πŸ“Š

Trend Following Strategy

Ride the momentum β€” let your winners run.

Start Automating Free β†’

Want to automate this strategy? Try auto-Trading free β€” no credit card required.

Trend Following Strategy chart

Overview

What is Trend Following Strategy?

Trend following is one of the oldest and most rigorously tested systematic trading approaches. Its core principle is simple: identify an established trend and trade in its direction until evidence of reversal emerges. The philosophy is captured in the adage "the trend is your friend β€” until it ends."

The strategy is inherently reactive β€” it does not predict where price will go, only identifies which direction it is currently moving and positions accordingly. Trend followers accept that they will miss the beginning and end of every trend but seek to capture the substantial middle portion.

Entry signals are typically generated by breakouts of recent highs or lows, moving average crossovers, or Donchian channel breakouts. Position sizing often uses ATR-based volatility targeting: larger positions in low-volatility environments, smaller ones when volatility spikes, so that every trade represents a roughly equal risk. Exits are governed by trailing stops rather than fixed profit targets β€” the position rides as long as the trend continues.

The strategy performs best in strongly trending markets (commodities, currencies, crypto during bull runs) and struggles in range-bound or mean-reverting environments. Diversification across many uncorrelated markets is the standard approach to smooth the inevitable drawdown periods.

How It Works in auto-Trading

Automate It

auto-Trading implements trend following by combining a trend detection indicator (ADX > 25 or price above/below a 200-period EMA) with a breakout entry trigger. Once in a trade, a dynamic trailing stop based on ATR multiples moves in the direction of the trend to lock in profits while allowing the position to breathe.

Try Free β†’

Strategy Code

Pick a script below, copy it, and use it on your chart.

Pine Script (TradingView)

This is a TradingView Pine Script strategy example for this page concept. Paste it into the TradingView Pine Editor, add it to your chart, and run it in the Strategy Tester.

//@version=6
strategy("Trend Following Strategy", overlay=true)
adxLen = input.int(14, "ADX Length")
emaLen = input.int(100, "Trend EMA")
adx = ta.adx(adxLen)

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

ThinkScript (thinkorswim)

This is a thinkorswim ThinkScript strategy example for this page concept. Open thinkorswim, create a custom strategy, paste the script, and apply it to your chart.

input adxLength = 14;
input emaLength = 100;
def adxVal = ADX(adxLength);
def emaVal = ExpAverage(close, emaLength);
def buySignal = close > emaVal and adxVal > 25;

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

Ready to automate Trend Following Strategy?

Join thousands of traders who use auto-Trading to execute this strategy automatically, 24/7.

Get Started Free β†’

All Strategies & Signals

Continue Learning

Trading Strategies

Trading Signals & Indicators