OPEN-SOURCE SCRIPT
[eLm] 0-1-2

# 📈 Market Structure Indicator – Counter System
This indicator dynamically analyzes price action to detect key market structure shifts and trend strength using four essential formations:
## 🔍 Detected Structures
- **Higher High (HH):** A candle forming a new high above recent peaks
- **Lower Low (LL):** A candle forming a new low below recent bottoms
- **Higher Low (HL):** A higher dip, indicating potential trend continuation
- **Lower High (LH):** A lower peak, signaling potential weakness
## 🧠 Structure Protection Logic
After a HH or LL is formed, if price does not breach that level within a user-defined number of candles, the level is considered **"protected."**
This provides insight into trend strength and market reaction.
## 🔢 HL / LH Counter System
- Each HL or LH increases a counter.
- A new HH or LL **resets** the corresponding counter to zero.
> This helps visualize how many consecutive HL or LH structures have occurred — useful for measuring trend momentum.
## 🎯 Use Cases
- Trend following and confirmation
- Early trend reversal detection
- Building structure-based trading strategies
- Understanding price behavior and market intent
---
> **Note:** This indicator does not provide financial advice. It is designed to support technical analysis with clear, structure-based visual signals.
This indicator dynamically analyzes price action to detect key market structure shifts and trend strength using four essential formations:
## 🔍 Detected Structures
- **Higher High (HH):** A candle forming a new high above recent peaks
- **Lower Low (LL):** A candle forming a new low below recent bottoms
- **Higher Low (HL):** A higher dip, indicating potential trend continuation
- **Lower High (LH):** A lower peak, signaling potential weakness
## 🧠 Structure Protection Logic
After a HH or LL is formed, if price does not breach that level within a user-defined number of candles, the level is considered **"protected."**
This provides insight into trend strength and market reaction.
## 🔢 HL / LH Counter System
- Each HL or LH increases a counter.
- A new HH or LL **resets** the corresponding counter to zero.
> This helps visualize how many consecutive HL or LH structures have occurred — useful for measuring trend momentum.
## 🎯 Use Cases
- Trend following and confirmation
- Early trend reversal detection
- Building structure-based trading strategies
- Understanding price behavior and market intent
---
> **Note:** This indicator does not provide financial advice. It is designed to support technical analysis with clear, structure-based visual signals.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。