PROTECTED SOURCE SCRIPT

Mirpapa : High/Low all sweep

155
# ๐Ÿ“˜ 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*

Declinazione di responsabilitร 

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.