OPEN-SOURCE SCRIPT
Higher High Lower Low

Higher High Lower Low 🦉{Phanchai} — TradingView Description
Structure detector with dynamic Support/Resistance, customizable labels, and ready-made alerts (Pine v6).
What it does
How it works (in short)
Alerts included
How to use (quick start)
Notes & tips
Built with Pine v6. Clean, compact labels; segmented S/R that updates only on confirmed changes; comprehensive alerts ready for automation.
Structure detector with dynamic Support/Resistance, customizable labels, and ready-made alerts (Pine v6).
This script marks market structure turning points — HH (Higher High), HL (Higher Low), LH (Lower High), LL (Lower Low) — and builds segmented Support/Resistance lines from those turns. Labels and colors are fully customizable and the script ships with multiple alert conditions.
What it does
- Detects swing pivots using left/right bar windows, then classifies each confirmed swing as HH/HL/LH/LL.
- Plots compact labels at the confirmed pivot bars with tooltips (English).
- Derives dynamic Support/Resistance: every time structure flips, the previous level is closed and a new segment starts, extending to the right.
- Provides alert conditions for any label and for specific first-occurrence shifts (e.g., first HH after a bearish label).
How it works (in short)
- A pivot high/low confirms only after Right Bars candles have closed; labels and S/R appear at that confirmation bar.
- An internal backbone (zigzag-like) is built from confirmed pivots, with light consistency checks to avoid contradictory sequences.
- Structure rules compare the recent five pivots (A…E) to decide HH/HL/LH/LL.
- S/R is updated from structure: e.g., in an up leg, new HLs refresh Support; in a down leg, new LHs refresh Resistance.
Alerts included
- Any structure label (HH/HL/LH/LL) — Fires on any new label.
- First LL after HL/HH — First bearish break after a bullish label.
- First HH after LL/LH — First bullish break after a bearish label.
- LL or HL formed — Any low-side label.
- LH or HH formed — Any high-side label.
- HL formed
- HH formed
- LL formed
- LH formed
How to use (quick start)
- Add the indicator to your chart.
- Choose Left/Right Bars for your timeframe (e.g., 5–10 for intraday; larger for higher timeframes).
- Pick your label colors/sizes and S/R style.
- Right-click the chart → Add alert… → Condition: this indicator → select the desired alert.
Notes & tips
- Because pivots require Right Bars to confirm, labels and S/R appear with a natural delay of that many bars. This avoids repainting.
- Raising Left/Right Bars reduces noise and increases the average distance between pivots; lowering them increases sensitivity.
- Structure is strict: sometimes you may see two HL (or two LH) in a row if the intermediate opposite swing didn’t qualify as HH/LH (or LL/HL).
- S/R segments are drawn with line objects; they are controlled via Inputs (style/width/color), not the Style tab.
- This tool highlights structure; it’s not a standalone entry/exit system. Combine with volume, trend, or risk management rules.
Built with Pine v6. Clean, compact labels; segmented S/R that updates only on confirmed changes; comprehensive alerts ready for automation.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.