OPEN-SOURCE SCRIPT
Trapper Market Structure (HH, HL, LH, LL)

This script is designed to visually identify price action market structure in real time using pivot-based logic. It highlights the key components of trend direction by labeling:
- **HH** – Higher Highs
- **HL** – Higher Lows
- **LH** – Lower Highs
- **LL** – Lower Lows
These labels help traders track evolving market conditions and spot trend continuations, breaks in structure, or potential reversals — all without guessing.
**How It Works**
The script detects local swing highs and lows based on a customizable pivot strength. Once a valid pivot is confirmed, it’s classified in context with the previous relevant pivot to determine its structural significance.
For example:
- If a pivot high is higher than the previous, it’s marked as a **HH**.
- If a pivot low is lower than the previous, it’s marked as a **LL**, and so on.
This running analysis helps traders anticipate shifts between bullish and bearish structures.
**Customizable Features**
- Adjust **Pivot Strength** to increase or reduce sensitivity (more reactive or more stable)
- Toggle **Labels** on/off for cleaner charts
- Toggle **Connecting Lines** between pivots to visualize structure flow
**Use Case**
This indicator is ideal for:
- Price action traders
- Market structure analysis
- Identifying entry zones during pullbacks (e.g., buying at HLs during uptrends)
- Confirming trend reversals or break-of-structure (BoS)
You can use this tool as a foundation for more advanced systems such as CHoCH/BOS detection, liquidity zones, or sniper-style entry frameworks.
**Concepts Used**
- Swing High/Low detection using `ta.pivothigh` and `ta.pivotlow`
- Market structure labeling logic
- Visual flow to reinforce trader psychology on trend states
Disclaimer
This script is provided for educational purposes only. It is not financial advice and should not be relied upon for trading decisions. Always conduct your own analysis and risk management.
#marketstructure #priceaction #technicalanalysis #tradingviewopen #pivotpoints
- **HH** – Higher Highs
- **HL** – Higher Lows
- **LH** – Lower Highs
- **LL** – Lower Lows
These labels help traders track evolving market conditions and spot trend continuations, breaks in structure, or potential reversals — all without guessing.
**How It Works**
The script detects local swing highs and lows based on a customizable pivot strength. Once a valid pivot is confirmed, it’s classified in context with the previous relevant pivot to determine its structural significance.
For example:
- If a pivot high is higher than the previous, it’s marked as a **HH**.
- If a pivot low is lower than the previous, it’s marked as a **LL**, and so on.
This running analysis helps traders anticipate shifts between bullish and bearish structures.
**Customizable Features**
- Adjust **Pivot Strength** to increase or reduce sensitivity (more reactive or more stable)
- Toggle **Labels** on/off for cleaner charts
- Toggle **Connecting Lines** between pivots to visualize structure flow
**Use Case**
This indicator is ideal for:
- Price action traders
- Market structure analysis
- Identifying entry zones during pullbacks (e.g., buying at HLs during uptrends)
- Confirming trend reversals or break-of-structure (BoS)
You can use this tool as a foundation for more advanced systems such as CHoCH/BOS detection, liquidity zones, or sniper-style entry frameworks.
**Concepts Used**
- Swing High/Low detection using `ta.pivothigh` and `ta.pivotlow`
- Market structure labeling logic
- Visual flow to reinforce trader psychology on trend states
Disclaimer
This script is provided for educational purposes only. It is not financial advice and should not be relied upon for trading decisions. Always conduct your own analysis and risk management.
#marketstructure #priceaction #technicalanalysis #tradingviewopen #pivotpoints
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。