# Halftrend

A Trend concept (Trend-following systems) in the LuxAlgo Library, with 1 indicator implementation.

## What is Halftrend?

Halftrend is a trailing trend line known for going flat when the market pauses. Over an 'amplitude' lookback it tracks the lowest low while in an up state, ratcheting the line higher only when that floor rises, and the highest high while in a down state, stepping the line lower as the ceiling falls. The state flips when a moving average of the highs (or lows) crosses through the line's level with price confirming, and most versions wrap the line in a half-width [ATR](https://www.luxalgo.com/library/concept/atr/) channel and mark each flip with an arrow.

The indicator is community-bred: it emerged from the MetaTrader ecosystem, circulated through forum ports for years without a canonical paper or named inventor, and reached its current popularity through widely used TradingView conversions. That lineage explains its loose edges, since implementations differ in small ways (flip conditions, channel width, default settings), and any serious use starts by reading the exact port in hand.

It belongs to the stop-and-reverse family alongside [Supertrend](https://www.luxalgo.com/library/concept/supertrend/) and [NRTR](https://www.luxalgo.com/library/concept/nrtr/): one line, two states, flips traded as signals. Its signature is the long horizontal shelf during consolidation, which avoids the drift a moving average shows in chop, though not the whipsaw; tight ranges can still flip it repeatedly, and the flat line always concedes some lag at genuine turns.

The flat shelf is the design's actual content. A moving average keeps sliding toward price during a pause, quietly eroding the distance a trailing stop enjoys; Halftrend's ratchet only moves on new extremes, so consolidation leaves both the line and any stop referenced to it exactly where the last thrust put them. The price of that stillness is paid at reversals, where the line waits for its crossing condition while a faster trail would already have flipped.

## How to read Halftrend on a chart

One line, two states: the reading is the state, the shelf, and the flip.

1. Plot the indicator with its amplitude setting (2 is a common default) and note the state by color or position: line below price is the up state, above price the down state.
2. Read the shelf: a flat line during consolidation means no new extreme has printed; the trend thesis is paused, not broken.
3. Watch the ratchet: each step of the line marks a fresh extreme in the trend's direction, the indicator's definition of progress.
4. Treat the arrows as state flips, not automatic trades: each is the crossing condition firing, and in ranges they alternate quickly.
5. Use the ATR half-channel as the buffer zone: wicks inside it are noise by construction, and stops referenced outside it survive ordinary backfill.
6. Filter by a higher timeframe: flips against the larger trend state are the ones that historically whipsaw most.

## How traders use it

- As a regime filter: the line's state gates direction, with longs considered only above a rising line and shorts only below a falling one.
- As flip signals: the arrows at state changes serve as entry or exit triggers, typically filtered by higher-timeframe bias because range-bound flips are frequent and unreliable.
- As a trailing reference: the flat shelf and its ATR channel give a stop location that stays put through pauses instead of creeping toward price.
- As a partner to breakout logic: a flat shelf under a tightening range plus a [breakout](https://www.luxalgo.com/library/concept/breakout/) close beyond the range is a natural pairing, the shelf marking where the failed-break case is proven.
- As one layer in a trend stack: agreement between Halftrend's state, an [MA slope filter](https://www.luxalgo.com/library/concept/ma-slope-filter/), and a broader [trend regime label](https://www.luxalgo.com/library/concept/trend-regime-label/) makes a sturdier gate than any single flip line.

## Halftrend vs other trailing state tools

- **Supertrend** (https://www.luxalgo.com/library/concept/supertrend/): Supertrend trails price at an ATR multiple, so its line drifts with volatility and flips on a simple price cross. Halftrend anchors to recent extreme highs and lows and flips on a moving-average condition, sitting flat where Supertrend tightens.
- **Moving Average Crossovers** (https://www.luxalgo.com/library/concept/moving-average-crossovers/): Crossovers derive state from two smoothed consensuses crossing, which drifts continuously and lags symmetrically. Halftrend derives state from extremes and ratchets, so it holds still in pauses and steps discretely with new highs or lows.
- **MA Slope Filter** (https://www.luxalgo.com/library/concept/ma-slope-filter/): A slope filter grades trend by the gradient of one average, a continuous measure with no levels attached. Halftrend outputs a level (the line and its channel) plus a binary state, which is why it doubles as a stop reference while a slope read cannot.

## FAQ

### What does the amplitude setting in Halftrend do?

Amplitude sets the lookback for the highest-high and lowest-low tracking and for the moving averages of highs and lows that drive flips. Larger values make the line flatter and slower, flipping less often but conceding more at turns; smaller values follow price sooner and whipsaw more in ranges. No value removes false flips, so it is tuned per market and timeframe.

### Is Halftrend better than Supertrend?

Neither dominates. Supertrend trails price by an ATR multiple, so its line drifts with volatility and flips on a price cross; Halftrend anchors to recent extreme highs and lows and sits flat through pauses, flipping on its moving-average condition. Halftrend tends to hold still in consolidation while Supertrend tightens, but both whipsaw in ranges and lag at real turns. Test both on your market.

### Does Halftrend repaint?

Properly written ports do not repaint closed bars: the line and state are fixed once a bar completes. What users often mistake for repainting is intra-bar provisionality, where the flip condition is met mid-bar and withdrawn before the close. Signal-on-close settings remove that, and since implementations vary, checking the specific port's behavior on live bars is part of due diligence.

### How should the ATR channel around the line be used?

As tolerance. The half-ATR band marks the excursion the indicator considers noise, so wicks into it are expected behavior rather than signals, and stops placed at or beyond its far edge survive routine backfill toward the line. Some traders also read touches of the channel that immediately reject as continuation entries in the direction of the standing state.

### What are reasonable Halftrend settings for scalping versus swing trading?

Smaller amplitudes react faster and suit short holding periods, while larger ones slow the line for swing horizons; the popular defaults sit in between. There is no verified constant per style, and the ranges quoted in trading content are conventions, not tested truths. The honest procedure is the boring one: fix your timeframe, sweep the amplitude across a sensible range, and judge the flips against your own execution costs.

### Can Halftrend be used alone as a trading system?

It is a complete state machine, so mechanically yes, and that is exactly how it whipsaws accounts in ranges. The line has no concept of chop: it will flip on every failed rotation of a tight range. Users who keep it typically add a range filter, a higher-timeframe gate, or structural confirmation, letting Halftrend time entries only where a trend thesis already exists.

## Implementations in the Library

- Halftrend (LuxAlgo): https://www.luxalgo.com/library/indicator/halftrend/

## Related concepts

- Supertrend: https://www.luxalgo.com/library/concept/supertrend/
- Parabolic SAR: https://www.luxalgo.com/library/concept/parabolic-sar/
- Chandelier Stop: https://www.luxalgo.com/library/concept/chandelier-stop/
- Donchian Trend Rules: https://www.luxalgo.com/library/concept/donchian-trend-rules/
- ATR Trailing Regime: https://www.luxalgo.com/library/concept/atr-trailing-regime/
- Gann HiLo Activator: https://www.luxalgo.com/library/concept/gann-hilo-activator/
- Alligator: https://www.luxalgo.com/library/concept/alligator/
- NRTR: https://www.luxalgo.com/library/concept/nrtr/
- Chande Kroll Stop: https://www.luxalgo.com/library/concept/chande-kroll-stop/
- Trend Magic: https://www.luxalgo.com/library/concept/trend-magic/

---

Source: https://www.luxalgo.com/library/concept/halftrend/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/