What is the Half-Trend Strategy?
Half-Trend is a sophisticated trend-following indicator that determines market direction using a combination of recent highest-highs, lowest-lows, and ATR-based channel bands. Unlike simple moving average crossovers, it uses a stateful loop algorithm that tracks the current trend counter โ only reversing when a genuine price breach of the channel occurs.
The result is a smooth trend signal that stays in trends longer and generates fewer whipsaws compared to most other trend indicators. It's particularly effective on 15-minute and hourly charts for NSE F&O instruments.
Technical Specifications
How the Algorithm Works
The AFL uses a stateful iterative approach. On each bar, it checks:
- If current trend is UP (trend > 0): Trail the main line to max of previous main and current low. If upper band falls below main AND close breaks below prior low โ flip to DOWNTREND.
- If current trend is DOWN (trend < 0): Trail the main line to min of previous main and current high. If lower band rises above main AND close breaks above prior high โ flip to UPTREND.
- If no prior trend (trend = 0): Initialize based on whether close is rising or falling relative to prior close.
Parameters & Tuning Guide
| Parameter | Default | Range | Effect |
|---|---|---|---|
Amplitude | 3 | 1โ10 | HHV/LLV lookback. Lower = faster reaction; higher = smoother but more lag. |
Channel Deviation | 3 | 1โ10 | Width of ATR channel. Higher = wider bands, fewer signals. Lower = tighter, more signals. |
Show ATR Channels | SHOW | SHOW/HIDE | Toggle the visual ATR channel bands on the chart. |
Best Use Cases
Positional Trading
On daily charts, Half-Trend identifies multi-week trends in Nifty 50 stocks. Amplitude=3, ChannelDev=3 works well for most large-cap NSE stocks.
Intraday Swing
On 15-minute charts with Amplitude=2, ChannelDev=2 for more reactive signals in BankNifty and MCX Gold futures.