OPEN-SOURCE SCRIPT

[eLm] 0-1-2

5 029
# 📈 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.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.