OPEN-SOURCE SCRIPT

[eLm] 0-1-2

1 374
# 📈 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.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。