OPEN-SOURCE SCRIPT

Zaka Pro: Clear Structure (HH/LL) + MSS Zones

261
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.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.