PROTECTED SOURCE SCRIPT

Key Levels

69
**Key Levels** is a multifunctional price action tool that helps traders identify and visualize important market structures. It combines advanced detection methods to highlight **Breakaway Gaps (BAGs)**, **Volume Imbalances (VIs)**, and **Failure Swings (FS)**—offering insight into key price areas where momentum shifts or liquidity imbalances may exist.

---

### 🔍 **Core Features**

#### 🟢 Breakaway Gaps (BAG)

* Detects gaps formed during strong momentum following a **structure break**.
* Uses swing-based logic (inspired by LuxAlgo-style) to confirm breaks and highlights unfilled gaps with shaded boxes.
* Gaps are auto-removed once price closes beyond the gap boundary.

#### 📊 Volume Imbalances (VI)

* Identifies bullish and bearish volume imbalance zones using multi-bar logic.
* Boxes extend to the right and are removed when the imbalance is considered filled.
* Helps locate thinly traded zones that may act as **support/resistance**.

#### 🔁 Failure Swings (FS)

* Highlights failed attempts to break recent highs/lows, marking them with **horizontal signal lines** (BSL/SSL).
* Tracks price interaction with these levels and visually fades or deletes them based on proximity or invalidation.
* Useful for identifying **liquidity hunts** or **false breakouts**.

---

### ⚙️ **Customizable Settings**

* Toggle individual features: BAGs, VIs, FS.
* Control maximum number of elements per type.
* Adjust:

* Box colors, label sizes, transparency.
* Swing and gap detection lengths.
* Line thickness and spacing sensitivity.

---

### 🔔 **Alerts**

This version does not include alert conditions directly in the script, but visual objects update in real-time for discretionary analysis.

---

### 📈 Use Cases

* Highlight unfilled inefficiencies for mean reversion strategies.
* Track momentum shifts after structural breaks.
* Identify and respond to failed swing attempts near recent highs/lows.
* Inform stop-loss/entry placement near key technical levels.

---

### ✅ Notes

* Built with **Pine Script v6**
* Lightweight, real-time, and non-repainting.
* Designed for use across all markets and timeframes.

---

### 📚 Disclaimer

This script is a **technical tool** intended for educational and analytical purposes only. It does **not provide financial advice** or guaranteed trade signals.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.