OPEN-SOURCE SCRIPT
Liquidity Sweep Guardian (Universal % or point based)

Liquidity Sweep Guardian - Complete User Guide
## Overview
The **Liquidity Sweep Guardian** is a visual warning system designed to prevent premature counter-trend trades (fades) near Previous Day High (PDH) and Previous Day Low (PDL) levels. This indicator helps you avoid one of the most common trading mistakes: fading too early before liquidity sweeps complete.
---
## 🎯 Core Trading Principle
### **THE GOLDEN RULE: Don't Fade Until It's Unlocked**
Price often **accelerates into key levels** to sweep liquidity before reversing. Trading against this momentum is extremely dangerous.
**The Process:**
1. **Danger Zone** (Red/White Box) = ⚠️ **DO NOT FADE** - Sweep likely incoming
2. **Sweep Occurs** (Triangle marker appears) = Price penetrates the level
3. **Reclaim Happens** (Price returns above/below level) = Level is tested
4. **🔓 UNLOCKED** (Gold border, green label) = **NOW you may CONSIDER a fade**
> **Important:** "UNLOCKED" means you may now *consider* a fade setup. It is NOT a trade signal itself. You still need your entry confirmation, risk management, and trade plan.
---
## 📊 Visual Elements Explained
### 1. **Danger Zone Boxes (Red Border by Default)**
**Two types of zones around PDH/PDL:**
- **Outer Danger Zone** (White fill): ±75pts (or 0.30%) around the level
- Indicates proximity to a key level where sweeps commonly occur
- Yellow/cautious trading zone
- **Inner Critical Zone** (Black fill): ±25pts (or 0.10%) around the level
- Highest probability area for liquidity sweep traps
- Avoid fading here at all costs
**What to do:**
- When price enters these zones, **wait and watch**
- Do not initiate counter-trend positions
- Allow the sweep to play out
### 2. **Unlocked Zones (Gold Border #ffeb3b)**
When a zone turns **gold/yellow** with green fill:
- The level has been swept AND reclaimed
- The liquidity grab is complete
- You may now look for fade opportunities with proper confirmation
### 3. **PDH/PDL Lines**
- **PDH Line** (Red): Previous Day High with price label
- **PDL Line** (Green): Previous Day Low with price label
- These are your key reference levels for the session
### 4. **Sweep Labels**
**Triangle Markers (SWEEP):**
- **Green Triangle** = Clean sweep (10-25pts penetration)
- **Orange Triangle** = Extended sweep (25-50pts penetration)
- **Red Triangle** = Deep penetration (50+ pts) - likely continuation, not reversal
**Warning Labels:**
- **⚠️ DEEP CONTINUATION?** = Penetration too deep, probably NOT a reversal setup
**Unlock Labels:**
- **🔓 LONG UNLOCKED** = PDL swept and reclaimed, may consider long fades
- **🔓 SHORT UNLOCKED** = PDH swept and reclaimed, may consider short fades
---
## ⚙️ Settings Guide
### **Calculation Mode**
**Use Percentage Mode (Default: ON)**
- ✅ **Enabled**: Universal mode - works on NQ, ES, RTY, stocks, crypto, forex
- ❌ **Disabled**: Fixed points mode - for specific instruments only
**When to use each:**
- **Percentage Mode**: Trading multiple instruments, or instruments with varying price levels
- **Fixed Points Mode**: Single instrument focus (e.g., only trading NQ at current levels)
### **Danger Zone Settings**
**Percentage Mode (Default for Universal Use):**
- **Danger Zone**: 0.30% each side (≈75pts on NQ25,000)
- **Critical Zone**: 0.10% each side (≈25pts on NQ25,000)
**Fixed Points Mode (For NQ Specifically):**
- **Danger Zone**: 75 points each side
- **Critical Zone**: 25 points each side
**Adjustment Tips:**
- For more volatile instruments: Increase percentages/points
- For less volatile instruments: Decrease percentages/points
- For higher timeframes: Use wider zones
- For lower timeframes: Use tighter zones
### **Sweep Classification**
**What defines a "real" sweep:**
- **Minimum**: 10pts / 0.04% - Shallow penetration may not grab enough liquidity
- **Optimal**: 10-25pts / 0.04-0.10% - "Goldilocks zone" for reversal setups
- **Extended**: 25-50pts / 0.10-0.20% - Deeper sweep, less reliable
- **Continuation**: 50+pts / 0.20%+ - Too deep, likely NOT reversing
**Max Bars for Reclaim**: 5 bars (default)
- Price should reclaim the level relatively quickly
- If it takes too long, the sweep may have failed
### **Visual Customization**
**Box Settings:**
- **Left Extension**: 60 bars (how far back the box extends)
- **Right Extension**: 50 bars (how far forward the box extends)
**Toggle Options:**
- Show/Hide Danger Zone Boxes
- Show/Hide PDH/PDL Lines
- Show/Hide Price Labels on lines
- Show/Hide Sweep Labels
- Show/Hide Unlock Labels
### **Color Customization**
All colors are fully customizable:
- Danger Zone Fill & Border
- Critical Zone Fill & Border
- Unlocked Zone Fill & Border
- PDH/PDL Line Colors
- PDH/PDL Label Colors
- Border Widths (1-5 pixels)
- Line Widths (1-5 pixels)
---
## 🎓 Trading Strategy Examples
### **Example 1: Long Setup at PDL**
1. **Morning**: Price approaches PDL (danger zone appears)
2. **Don't Fade Yet**: Price enters critical zone - resist urge to buy
3. **Sweep**: Price drops 15pts below PDL (green triangle appears)
4. **Reclaim**: Price closes back above PDL within 3 bars
5. **🔓 UNLOCKED**: Gold border + "LONG UNLOCKED" label appears
6. **Trade Setup**: Now look for bullish confirmation (order flow, structure, etc.)
### **Example 2: Avoiding a Trap at PDH**
1. **Afternoon**: Price rallies into PDH danger zone
2. **Temptation**: You want to short here (it "looks toppy")
3. **Sweep**: Price breaks 50pts above PDH (red triangle + ⚠️ warning)
4. **Continuation**: Deep penetration suggests continuation, not reversal
5. **Result**: No unlock occurs, price keeps running higher - trap avoided!
### **Example 3: Failed Unlock (No Trade)**
1. Price sweeps PDL by 12pts (green triangle)
2. Price struggles to reclaim PDL, stays below for 10+ bars
3. No "UNLOCKED" label appears
4. **Correct Action**: Do not fade - sweep failed to reclaim
---
## 📱 Alerts
The indicator includes built-in alerts for:
- **Entering Danger Zones**: Get warned when price approaches PDH/PDL
- **Sweep Detection**: Know immediately when a level is swept
- **Unlock Signals**: Get notified when fade setups become available
- **Continuation Warnings**: Alert when penetration suggests continuation
**To Set Alerts:**
1. Right-click indicator → "Add Alert"
2. Select desired alert condition
3. Configure notification preferences
---
## ⚠️ Important Disclaimers
### **What This Indicator IS:**
✅ A visual warning system to prevent premature fades
✅ A tool to identify when liquidity sweeps have completed
✅ A framework for counter-trend trade timing
### **What This Indicator IS NOT:**
❌ A complete trading system
❌ An entry signal generator
❌ A guarantee of trade success
❌ A substitute for proper risk management
### **Always Remember:**
- "UNLOCKED" = You may CONSIDER a fade (not a signal to trade)
- You still need your own entry confirmation
- You still need proper stop placement
- You still need position sizing and risk management
- Not every unlock leads to a successful trade
- Market context and order flow still matter
---
## 🔧 Recommended Settings by Instrument
### **NQ (Nasdaq-100 E-mini Futures)**
- Mode: Percentage or Fixed Points
- Percentage: 0.30% / 0.10% (default)
- Fixed Points: 75pts / 25pts (default)
### **ES (S&P 500 E-mini Futures)**
- Mode: Percentage
- Danger: 0.25% / Critical: 0.08%
- Or Fixed Points: 15pts / 5pts
### **RTY (Russell 2000 E-mini Futures)**
- Mode: Percentage
- Danger: 0.35% / Critical: 0.12%
- Or Fixed Points: 8pts / 3pts
### **Stocks (High Volume Large Caps)**
- Mode: Percentage (recommended)
- Danger: 0.20-0.40% / Critical: 0.08-0.15%
- Adjust based on ATR and volatility
### **Crypto (BTC, ETH)**
- Mode: Percentage (essential)
- Danger: 0.40-0.60% / Critical: 0.15-0.20%
- Higher volatility requires wider zones
---
## 💡 Pro Tips
1. **Use on Higher Timeframes**: Works best on 5min, 15min, 1hr charts
2. **Combine with Order Flow**: Use with footprint/delta for confirmation
3. **Watch Volume**: Strong volume on sweep = better reversal potential
4. **Consider Time of Day**: Sweeps during RTH often more reliable
5. **Multiple Timeframes**: Check if higher TF also shows unlock
6. **Don't Force Trades**: Not every session produces clean setups
7. **Journal Results**: Track which unlock types work best for you
8. **Respect Continuation Signals**: When indicator says "too deep," listen
---
## 🆘 Troubleshooting
**Q: Box isn't showing up**
A: Check that "Show Danger Zone Boxes" is enabled in Visual Settings
**Q: No price on labels**
A: Enable "Show Price Labels on Lines" in Visual Settings
**Q: Zones seem too tight/wide**
A: Adjust Danger Zone % or points based on current volatility
**Q: Getting too many/too few unlocks**
A: Adjust sweep classification thresholds (min/max penetration)
**Q: Want thicker/thinner lines**
A: Adjust line widths in "PDH/PDL Line Colors" section
**Q: Colors not matching my chart theme**
A: Fully customize all colors in the color settings groups
---
## 📚 Additional Resources
- Study price action around PDH/PDL on your instruments
- Learn about liquidity sweeps and stop hunts
- Understand market structure and order flow
- Practice identifying setups on replay/historical data
- Keep a trading journal of unlock scenarios
---
*Remember: The best trade is often the one you don't take. This indicator helps you avoid the trades you shouldn't take, so you can focus on the ones you should.*
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.