PROTECTED SOURCE SCRIPT
Mirpapa : High/Low all sweep

# 📘 Mirpapa : High/Low All Sweep
**Author:** © goodia
**Version:** v0.1.0 (Initial Public Release)
**Overlay:** true
**Max Boxes:** 500
**Language:** Pine Script v6
---
## 🧭 Overview
**Mirpapa : High/Low All Sweep** is a multi-timeframe rejection zone and sweep detection tool.
It automatically visualizes key swing-based **rejection boxes** across three timeframes — **current, mid, and high** — helping traders identify liquidity sweeps and breakout cycles in market structure.
Each rejection box dynamically tracks high/low sweeps and updates its visual state when both sides of the box are breached, representing a completed liquidity cycle.
---
## ⚙️ Features
✅ **Multi-Timeframe Support**
- Current, Mid, and High timeframe structure analysis
- Automatically adapts to your active chart timeframe
- Customizable mid/high timeframe mapping for each chart scale
✅ **Smart Rejection Box Detection**
- Detects candle-based **rejection swings (swing highs/lows)**
- Generates box zones from either `open/close` or `high/low` levels
- Monitors both top and bottom breakouts to mark full sweep cycles
✅ **Break Cycle Tracking**
- Each box tracks its own breakout count
- Box color automatically fades to gray when the final breakout cycle completes
✅ **Highly Customizable**
- Timeframe-specific box activation
- Adjustable colors, border width, and style (solid / dotted / dashed)
- Optional waiting for higher timeframe bar closures (`타임프레임 마감 대기`)
---
## 🧩 Technical Structure
| Component | Description |
|------------|-------------|
| **HTFData** | Structure containing multi-timeframe OHLC data |
| **SwingResult** | Detects swing highs/lows and rejection patterns |
| **BoxData** | Tracks each active box and its breakout status |
| **_ProcessCompleteBreakCycle()** | Core routine handling full sweep completion logic |
| **_HTF_request()** | Uses `request.security()` to fetch higher timeframe OHLC data |
| **_CalculateBoxCoordinates()** | Determines exact top/bottom of the rejection box |
| **_CreateRejectionBox()** | Draws box with configurable visual properties |
---
## 🧠 How It Works
1. **Swing Detection**
Identifies local swing highs/lows on each timeframe.
2. **Box Creation**
Creates a rejection box based on the previous candle’s body or full range.
3. **Breakout Monitoring**
Monitors price action to detect breaches of the box’s top and bottom.
4. **Cycle Completion**
When both sides are breached, the box is marked as “completed” and visually fades out.
---
## 🧱 Inputs Summary
| Category | Parameter | Description |
|-----------|------------|-------------|
| **Box Size** | true = open/close, false = high/low | Controls box height calculation |
| **Timeframe Wait** | Enable/disable | Wait for bar closure on HTF |
| **Break Count** | Default = 1 | Number of completed cycles before box removal |
| **Box Usage** | Enable current/mid/high | Control which timeframes are active |
| **Box Style** | Color / Border / Opacity | Customize box appearance |
| **Timeframe Mapping** | Set mid/high TF per chart TF | Flexible MTF adaptation |
---
## 🎨 Visual Notes
- 🟧 **Orange boxes** → Current timeframe rejections
- 🟦 **Aqua boxes** → Mid timeframe rejections
- 🟩 **Green boxes** → High timeframe rejections
- ⚫ **Gray boxes** → Fully swept (cycle completed)
---
## ⚠️ Notes & Best Practices
- Recommended to use with structure-based setups (ICT, FVG, OB).
- Ideal on 5min–4H charts for sweep and liquidity mapping.
- For performance reasons, limit `max_boxes_count` to ≤500 (default).
- If overlapping boxes occur, adjust timeframe mappings.
---
## 🧩 Future Updates (Planned)
- Volume-weighted rejection zones
- Auto-cleanup for aged boxes
- Sweep summary statistics (count, duration)
---
*© 2025 goodia — All rights reserved.*
*Mirpapa Project · Liquidity Sweep Visualization Suite*
**Author:** © goodia
**Version:** v0.1.0 (Initial Public Release)
**Overlay:** true
**Max Boxes:** 500
**Language:** Pine Script v6
---
## 🧭 Overview
**Mirpapa : High/Low All Sweep** is a multi-timeframe rejection zone and sweep detection tool.
It automatically visualizes key swing-based **rejection boxes** across three timeframes — **current, mid, and high** — helping traders identify liquidity sweeps and breakout cycles in market structure.
Each rejection box dynamically tracks high/low sweeps and updates its visual state when both sides of the box are breached, representing a completed liquidity cycle.
---
## ⚙️ Features
✅ **Multi-Timeframe Support**
- Current, Mid, and High timeframe structure analysis
- Automatically adapts to your active chart timeframe
- Customizable mid/high timeframe mapping for each chart scale
✅ **Smart Rejection Box Detection**
- Detects candle-based **rejection swings (swing highs/lows)**
- Generates box zones from either `open/close` or `high/low` levels
- Monitors both top and bottom breakouts to mark full sweep cycles
✅ **Break Cycle Tracking**
- Each box tracks its own breakout count
- Box color automatically fades to gray when the final breakout cycle completes
✅ **Highly Customizable**
- Timeframe-specific box activation
- Adjustable colors, border width, and style (solid / dotted / dashed)
- Optional waiting for higher timeframe bar closures (`타임프레임 마감 대기`)
---
## 🧩 Technical Structure
| Component | Description |
|------------|-------------|
| **HTFData** | Structure containing multi-timeframe OHLC data |
| **SwingResult** | Detects swing highs/lows and rejection patterns |
| **BoxData** | Tracks each active box and its breakout status |
| **_ProcessCompleteBreakCycle()** | Core routine handling full sweep completion logic |
| **_HTF_request()** | Uses `request.security()` to fetch higher timeframe OHLC data |
| **_CalculateBoxCoordinates()** | Determines exact top/bottom of the rejection box |
| **_CreateRejectionBox()** | Draws box with configurable visual properties |
---
## 🧠 How It Works
1. **Swing Detection**
Identifies local swing highs/lows on each timeframe.
2. **Box Creation**
Creates a rejection box based on the previous candle’s body or full range.
3. **Breakout Monitoring**
Monitors price action to detect breaches of the box’s top and bottom.
4. **Cycle Completion**
When both sides are breached, the box is marked as “completed” and visually fades out.
---
## 🧱 Inputs Summary
| Category | Parameter | Description |
|-----------|------------|-------------|
| **Box Size** | true = open/close, false = high/low | Controls box height calculation |
| **Timeframe Wait** | Enable/disable | Wait for bar closure on HTF |
| **Break Count** | Default = 1 | Number of completed cycles before box removal |
| **Box Usage** | Enable current/mid/high | Control which timeframes are active |
| **Box Style** | Color / Border / Opacity | Customize box appearance |
| **Timeframe Mapping** | Set mid/high TF per chart TF | Flexible MTF adaptation |
---
## 🎨 Visual Notes
- 🟧 **Orange boxes** → Current timeframe rejections
- 🟦 **Aqua boxes** → Mid timeframe rejections
- 🟩 **Green boxes** → High timeframe rejections
- ⚫ **Gray boxes** → Fully swept (cycle completed)
---
## ⚠️ Notes & Best Practices
- Recommended to use with structure-based setups (ICT, FVG, OB).
- Ideal on 5min–4H charts for sweep and liquidity mapping.
- For performance reasons, limit `max_boxes_count` to ≤500 (default).
- If overlapping boxes occur, adjust timeframe mappings.
---
## 🧩 Future Updates (Planned)
- Volume-weighted rejection zones
- Auto-cleanup for aged boxes
- Sweep summary statistics (count, duration)
---
*© 2025 goodia — All rights reserved.*
*Mirpapa Project · Liquidity Sweep Visualization Suite*
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Możesz jednak używać go swobodnie i bez żadnych ograniczeń – więcej informacji tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Możesz jednak używać go swobodnie i bez żadnych ograniczeń – więcej informacji tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.