Noon Barbari

Back to all indicators

half_trendStructure indicator

HalfTrend

Latched channel-extreme trend flipper (Pine port).

What it is

Latched channel-extreme trend flipper (Pine port).

HalfTrend (popularised by the Pine Script published by everget) draws a single stepped line under price in an uptrend and above price in a downtrend. Instead of ATR bands it uses raw channel extremes: the highest high and lowest low of the last N bars (the “amplitude”), together with N-bar moving averages of the highs and lows.

The line is latched: while the trend is up it only ratchets upward (tracking the ratcheted lowest-low level), and while the trend is down it only ratchets downward. A flip needs two things at once — the average of the lows (or highs) must cross the ratcheted extreme of the opposite side, and the close must break beyond the previous bar's high (or low). That double condition makes HalfTrend noticeably less flip-happy than a plain moving-average cross.

On a flip bar the new line starts exactly where the old line stood, so the indicator never gaps — it bends. Traders use it like SuperTrend: the line is the trailing stop, the side of the line is the trend filter, and flips are entry/exit signals.

Read the full HalfTrend definition in the glossary →

Live chart

TradingView has no built-in study for this indicator, so there's no live chart to embed here. It's a structure / smart-money tool — the best way to see it is to run it inside a strategy and backtest it.

Parameters

ParameterDefaultRange
Amplitude21 – 50

Output fields

The named values this indicator exposes to your entry and exit rules.

trailstate

Learn more on the blog

Deep-dive articles explaining this indicator and how to trade it.

Backtest this indicator

Drop this indicator into a rule-set, run it over years of BTC/USDT data, and see whether the edge is real or just curve-fit — no credit card required.