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*
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations โ learn more here.
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.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations โ learn more here.
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.