OPEN-SOURCE SCRIPT

Liquidity Sweeps [SB1]

175
### 🧠 **Liquidity Sweeps \[LuxAlgo] – Enhanced by SamB817**

> ⚠️ **Original Credit:** This script is built on the excellent foundation by **LuxAlgo**, licensed under [CC BY-NC-SA 4.0](creativecommons.org/licenses/by-nc-sa/4.0/). All core functionality and visual logic originates from LuxAlgo’s open-source framework. This version adds enhanced functionality tailored for precision intraday and swing entries using sweep behavior.

🔹 Overview
The Liquidity Sweeps [SB] indicator is designed to help traders spot bullish and bearish liquidity grabs, a key concept in smart money trading. It automatically detects swing highs and lows, identifies stop hunts, and highlights areas where institutional traders might be sweeping liquidity before price reverses.

🔹 How It Works

Detects liquidity sweeps by tracking swing points based on a user-defined lookback period.

Differentiates between:
✅ Wick-based liquidity grabs (stop hunts).
✅ Breakouts & retests (confirming liquidity sweeps).
✅ Both combined for deeper analysis.

Draws liquidity zones with extendable boxes to visualize areas where liquidity was taken.

Provides alerts when a liquidity sweep occurs. ---
---
### 📈 **WHAT THIS INDICATOR DOES**

This tool identifies **liquidity sweeps**—key moments where price **wicks above/below swing highs/lows**, often triggering stop losses or absorbing institutional orders. These zones frequently precede powerful reversals or continuations.

It draws:

* 🔹 **Dotted lines** at the top or bottom of the candle wicks when a sweep is confirmed.
* 🔹 **Shaded sweep zones** (boxes) which extend until price decisively trades through them.
* 🔹 **Breakout confirmation lines** when price reclaims or mitigates a swept level.

---

### 🔧 **FEATURES & ENHANCEMENTS BY SAM**

* ✅ **Dotted Lines Extension**: Liquidity sweep dotted lines now **automatically extend** until they’re traded through, allowing for reliable reference levels even dozens of bars later.
* ✅ **Thickness Upgrade**: Dotted lines now appear **thicker** for better visibility during fast market conditions.
* ✅ **Visual Cleanup**: Auto-deletion of outdated sweeps (older than 2000 bars or already mitigated).
* ✅ **Optimized Wicks-Only Mode**: Improved behavior when in *Only Wicks* mode, ideal for tracking stop hunts without false triggers.

---

### 🚨 **ALERTS INCLUDED**

1. 🔔 **New Bullish Sweep (Wick)**
2. 🔔 **New Bearish Sweep (Wick)**

These alerts let you react **in real-time** when liquidity has been swept and price is beginning to show directional intent.

---

### 📚 **HOW TO USE IT EFFECTIVELY**

1. **Timeframes**:

* Use on **2H / 4H** for swing setups.
* Use on **1min–15min** for scalping or day trading around NY/LO open.

2. **Entry Logic**:

* Wait for the **dotted line to form after a sweep**.
* **Do not enter immediately.** Wait for: Close of candle!!!!

* A clean **break of the sweep line**, OR
* A **retest of the line within 3–45 bars**, followed by rejection.

3. **Best When Combined With**:

* Fair Value Gaps (FVGs)
* Market Structure Shift (MSS)
* Order Flow Clusters
* Anchored VWAP and Volume Profile

---

### 💡 **TIPS & STRATEGIC INSIGHTS**

* **Sweeps on higher timeframes** (like 2H/4H) are more powerful and often mark **institutional reversals**.
* **Double lines** (dotted lines on both wick ends) = high-volatility trap. Wait for a clean break before entry.
* Use the **sweep box + dotted line** as a **zone**, not a pinpoint level.
* Be patient. Sweeps are **traps first**, **opportunities second**.

---

### 🔓 Attribution

Script forked and expanded from the open-source **LuxAlgo Liquidity Sweeps**. Original License: [CC BY-NC-SA 4.0](creativecommons.org/licenses/by-nc-sa/4.0/).
Enhancements by **SamB817**.

--- 🧠 1. It Tracks Sweep Behavior — Not Just Breakouts
Purpose: It identifies where liquidity has been taken — stops hit — not where price is "breaking out" in the traditional sense.
The dotted lines show wick-based stop hunts (liquidity raids).
The boxes show sweep zones, including body-to-wick range when applicable.
🟢 Use case: Smart money is taking stops here → expect reaction, not chase the move.

🕓 2. Timeframe Matters — Sweeps on Higher TF = More Impact
15m & 1h: Intraday trap sweeps, good for scalps or fast directional shifts.
2h/4h: Institutional-level sweeps. Often lead to major intraday reversals or the start of a new leg.
Daily/Weekly: Macro-level stops taken → these are often trend changers.
🔑 Rule of thumb: The higher the timeframe the sweep occurs on, the more meaningful the response tends to be.

🎯 3. Entry Logic: Always Wait for Price to Show Direction
After a sweep appears:
Wait for price to break above/below the dotted line or box, depending on the direction.
Don’t enter blindly on the sweep — it's a trap until proven otherwise.
✅ Best entries often occur on retests of the sweep line or area, especially 3–45 bars later (as you’ve already implemented).
🧲 4. Sweeps Often Magnetize Price
Liquidity sweeps act like magnets — if a sweep hasn't been hit yet, price may drift toward it to "collect" those orders.
Use this to anticipate potential targets and reversal zones.
🧪 5. Sweeps Work Best With These Confirmations:
🔹 FVG (Fair Value Gaps) in the same direction immediately after a sweep.
🔹 Market Structure Shift (MSS) right after a sweep = high-probability reversal.
🔹 Order Flow Confirmation: Strong buy/sell imbalances, absorption at sweep level.
🔹 Liquidity voids: If price sweeps and then enters an inefficient zone — fast move likely.
📊 6. Combines Best With These Tools:
Tool Why It Works Well With Sweeps
1.🎯🎯🧠 🧠 Order Flow (AlgoAlpha)Confirm absorption or intent at sweep zone🎯🎯🧠🧠 2.✅ Volume Profile - See if the sweep occurred at a low-volume node (ideal)
3.✅ VWAP or Anchored VWAP - Catch reclaims or rejections off institutional zones
4.✅ Session Highs/Lows Sweeps of session extremes are often the trap setups

🧩 7. Psychology Behind the Sweeps
Sweeps represent stop runs, trap moves, or liquidity grabs by larger players.
The goal is to trigger weak hands before moving in the true direction.
Train yourself to:
Expect the opposite of the sweep direction once structure confirms.
Think like the liquidity provider, not the victim.

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.