OPEN-SOURCE SCRIPT
Zaka Pro: Clear Structure (HH/LL) + MSS Zones

Certainly! Here is a description of the Pine Script indicator you provided, focusing on its main functions and trading strategy, written in English.
---
## Zaka Pro: Clear Structure (HH/LL) + MSS Zones
This is a technical analysis indicator developed in Pine Script (`//version=5`) designed to automatically identify and plot key price action structural elements based on the **Zig Zag** method, while incorporating a simplified **Market Structure Shift (MSS)** concept, often used in Smart Money Concepts (SMC) or Wyckoff trading.
### Key Features:
1. **Pivot-Based Structure Identification:**
* The indicator uses the standard **`ta.pivothigh`** and **`ta.pivotlow`** functions, determined by the user-defined `Pivot Length` (`prd`). This forms the foundation of the price "swing" structure.
2. **Structural Labeling (HH/LL/LH/HL):**
* It automatically labels the resulting swing points to clearly show the prevailing trend:
* **HH (Higher High):** Continuation of an uptrend.
* **LL (Lower Low):** Continuation of a downtrend.
* **LH (Lower High):** A potential reversal or weakening of an uptrend.
* **HL (Higher Low):** A potential reversal or weakening of a downtrend.
3. **Zig Zag Plotting:**
* The indicator connects the identified pivot points with a **gray line** to visually represent the market swings.
4. **Market Structure Shift (MSS) Strategy:**
* The core strategy detects a potential **trend reversal** when the price breaks the most recent structural pivot:
* **Buy MSS Trigger:** Detected when the price breaks **above the last High** (`last_high`) while the market was in a confirmed **downtrend** (forming Lower Lows).
* **Sell MSS Trigger:** Detected when the price breaks **below the last Low** (`last_low`) while the market was in a confirmed **uptrend** (forming Higher Highs).
5. **Order Block / Entry Zone Plotting:**
* Upon detection of a confirmed MSS (reversal), the indicator plots a colored **Box** representing a potential re-entry zone:
* **BUY ZONE (Green Box):** Plotted after a Buy MSS (breakout to the upside). The zone is defined by the **High and Low of the two candles preceding the last swing Low** (`ob_low_top`, `ob_low_btm`). This acts as a simplified "Order Block" for potential long entries.
* **SELL ZONE (Red Box):** Plotted after a Sell MSS (breakout to the downside). The zone is defined by the **High and Low of the two candles preceding the last swing High** (`ob_high_top`, `ob_high_btm`). This acts as a simplified "Order Block" for potential short entries.
6. **Alerts:**
* Custom alerts are included to notify the user immediately when a Buy or Sell MSS (Market Structure Shift) is detected.
In summary, the indicator is a visual tool that simplifies price action analysis by drawing structure and highlights potential reversal points (MSS) by painting corresponding re-entry zones (Order Blocks) on the chart.
---
## Zaka Pro: Clear Structure (HH/LL) + MSS Zones
This is a technical analysis indicator developed in Pine Script (`//version=5`) designed to automatically identify and plot key price action structural elements based on the **Zig Zag** method, while incorporating a simplified **Market Structure Shift (MSS)** concept, often used in Smart Money Concepts (SMC) or Wyckoff trading.
### Key Features:
1. **Pivot-Based Structure Identification:**
* The indicator uses the standard **`ta.pivothigh`** and **`ta.pivotlow`** functions, determined by the user-defined `Pivot Length` (`prd`). This forms the foundation of the price "swing" structure.
2. **Structural Labeling (HH/LL/LH/HL):**
* It automatically labels the resulting swing points to clearly show the prevailing trend:
* **HH (Higher High):** Continuation of an uptrend.
* **LL (Lower Low):** Continuation of a downtrend.
* **LH (Lower High):** A potential reversal or weakening of an uptrend.
* **HL (Higher Low):** A potential reversal or weakening of a downtrend.
3. **Zig Zag Plotting:**
* The indicator connects the identified pivot points with a **gray line** to visually represent the market swings.
4. **Market Structure Shift (MSS) Strategy:**
* The core strategy detects a potential **trend reversal** when the price breaks the most recent structural pivot:
* **Buy MSS Trigger:** Detected when the price breaks **above the last High** (`last_high`) while the market was in a confirmed **downtrend** (forming Lower Lows).
* **Sell MSS Trigger:** Detected when the price breaks **below the last Low** (`last_low`) while the market was in a confirmed **uptrend** (forming Higher Highs).
5. **Order Block / Entry Zone Plotting:**
* Upon detection of a confirmed MSS (reversal), the indicator plots a colored **Box** representing a potential re-entry zone:
* **BUY ZONE (Green Box):** Plotted after a Buy MSS (breakout to the upside). The zone is defined by the **High and Low of the two candles preceding the last swing Low** (`ob_low_top`, `ob_low_btm`). This acts as a simplified "Order Block" for potential long entries.
* **SELL ZONE (Red Box):** Plotted after a Sell MSS (breakout to the downside). The zone is defined by the **High and Low of the two candles preceding the last swing High** (`ob_high_top`, `ob_high_btm`). This acts as a simplified "Order Block" for potential short entries.
6. **Alerts:**
* Custom alerts are included to notify the user immediately when a Buy or Sell MSS (Market Structure Shift) is detected.
In summary, the indicator is a visual tool that simplifies price action analysis by drawing structure and highlights potential reversal points (MSS) by painting corresponding re-entry zones (Order Blocks) on the chart.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.