HalfTrend Indicator: TradingView Pine Script for Trend and Buy/Sell Signals
Knowing when the trend has actually flipped—instead of chasing noise—is one of the hardest parts of trend trading. I've found the HalfTrend (HT) indicator useful for that. It draws a single trend line that switches between support and resistance, plus an ATR-based channel around it, and it marks Buy and Sell only when the internal trend state changes. That keeps signals clear and avoids the clutter of many overlapping lines.
HalfTrend uses the Average True Range (ATR) and a short lookback (amplitude) to decide when price has broken the current structure. When the trend flips from down to up, you get a Buy signal and the line turns into support (often shown in blue); when it flips from up to down, you get a Sell signal and the line acts as resistance (often shown in red). The ATR High and ATR Low bands form a ribbon that shows the channel around the trend line. After testing it on multiple timeframes, I use it mainly as a trend filter and for reversal entries when the arrow and label appear. In this guide you'll see how HalfTrend is built, how to add and tune it in TradingView (including via Pineify), and how to use it in real strategies with clear entry, stop-loss, and take-profit rules.






