Learn
Trend 2 min read

Trend Following

A crossover you can trust — only takes trades the market is willing to fund.

EMA crossover gated by ADX trend strength and volume direction — only fires when the trend is real.

The idea

A moving-average crossover is the oldest signal in technical analysis. It also fails most of the time, because in sideways markets EMAs cross back and forth every few bars. The standard fix is to only take crossovers when a separate trend-strength filter confirms there is something to follow.

Trend Following uses three gates:

  1. EMA 9 above / below EMA 21 crossover on the current bar
  2. ADX > 25 (and the dominant directional indicator aligned with the signal)
  3. Volume trend bullish for buys, bearish for sells (last 20 bars)

Scoring

ConditionPoints
EMA crossover+2 (base)
ADX > 25 and +DI > -DI (for buys) or -DI > +DI (for sells)+2
Volume trend confirms+1

Threshold: 3 for normal signal, 4+ for a ✓✓ strong signal. Minimum 8 bars between signals.

How to use it

  1. Enable Trend Following in the Scripts panel.
  2. A single "Trend Buy" near a fresh ADX expansion is usually the start of a multi-day move. Position sizing matters more than precision entry.
  3. When the script prints on both a higher timeframe (1d) and the timeframe you trade (4h) within a few bars of each other, that is the cleanest setup you will see from this tool.
  4. Exit logic is your own problem. Common pairings: trailing stop under swing lows, exit on opposite signal, exit on divergence.

Why it works

Trends persist. Once a market is in an established trend, the path of least resistance is continuation. This script ignores all the "maybe a trend is starting" noise and only speaks when there is real evidence of directional flow.

Limits

  • It enters after the crossover, so you are giving up the first leg. That's the price of avoiding fakeouts.
  • It produces zero signals in ranging markets. If you see weeks with nothing, that is a feature — the market isn't trending.
  • Strong macro reversals can invalidate the trend faster than ADX drops below 25, so use stops.

Frequently asked

Why 9 and 21?
Short enough to react to real moves, long enough to ignore single-candle spikes. Classic Linda Raschke combo — well-behaved on crypto timeframes.
Why require ADX > 25?
ADX measures trend strength. Below 20 is chop, above 25 is a real trend. Gating by ADX kills the vast majority of false EMA-crossover signals.
Can I change the EMA periods?
The default is 9/21. If you need different periods, edit the EMA layer itself and the script picks up from your chart configuration.