업데이트됨

HH/LL Trendlines [twr]

9 141
Automatically detects swing structure (HH/HL/LH/LL) using pivot highs/lows, labels each swing point, and — the key feature — draws trendlines connecting same-type consecutive pivots: LH→LH on the high side, HL→HL on the low side. This visualizes the two "structure lines" traders watch for trend continuation and potential breaks.
How it works
  • Pivot detection & classification
  • Uses ta.pivothigh()/ta.pivotlow() with a user-defined Swing Length (fractal-style, symmetric lookback/lookforward)
  • Each new swing high is compared to the prior swing high: higher → labeled HH (bullish, green), lower → labeled LH (bearish, red)
  • Each new swing low is compared to the prior swing low: lower → labeled LL (bearish, red), higher → labeled HL (bullish, green)
  • First pivot on each side gets a neutral "x" label since there's nothing to compare against yet

스냅샷
Trendline logic
  • Only connects pivots of the same classification — so a LH connects to the previous LH (skipping over any HH in between), and a HL connects to the previous HL. This produces clean descending-resistance / ascending-support structure lines rather than zigzagging between every pivot.
  • Lines are capped per side (Max Trend Lines Shown) using an array-based pool with oldest-first trimming, so the chart doesn't get cluttered over time

Live projection
  • If Project Lines Forward is enabled, each line's slope is recalculated every bar and extended to the current bar (getProjectedY()), so the structure line behaves like a live trend channel boundary rather than a static segment frozen at the two pivot points
  • Optional Remove Line Once Price Crosses It will auto-delete a line when price closes (or wicks, depending on Cross Source) through the projected level — useful for treating the line as an invalidated trendline break

Inputs summary
  • Structure: swing length, label toggle
  • Trend Lines: enable high/low connections independently, line width/style, max lines per side
  • Projection: forward extension toggle, cross-removal toggle, cross source (Close vs High/Low)
  • Colors: bullish/bearish color customization
릴리즈 노트
Added ZigZag with live line

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.