PROTECTED SOURCE SCRIPT
Updated TradeCraftly - 4 Flag Pattern

🚀 4 Flag
This indicator highlights **hidden market compression** by detecting a powerful **4-candle alternating pattern** where price remains tightly balanced between buyers and sellers.
It identifies sequences where candles **strictly alternate in direction** (Green-Red-Green-Red or Red-Green-Red-Green) while price stays **compressed within a shared Open-Close range**, filtering out noise and false consolidations using smart wick control.
The result is a **clean visual range box** that marks areas of **absorption, balance, and potential breakout energy**—often appearing just before strong directional moves.
---
### 💡 Ideal For
* Spotting **pre-breakout consolidation**
* Identifying **liquidity build-up zones**
* Timing **breakout or expansion trades**
* Enhancing entries with **VWAP, CPR, or session levels**
---
### ✅ Key Features
* Works on **any chart timeframe**
* **Non-repainting**
* Noise-filtered using **wick-to-body logic**
* Simple, clean, and **trader-focused**
This indicator highlights **hidden market compression** by detecting a powerful **4-candle alternating pattern** where price remains tightly balanced between buyers and sellers.
It identifies sequences where candles **strictly alternate in direction** (Green-Red-Green-Red or Red-Green-Red-Green) while price stays **compressed within a shared Open-Close range**, filtering out noise and false consolidations using smart wick control.
The result is a **clean visual range box** that marks areas of **absorption, balance, and potential breakout energy**—often appearing just before strong directional moves.
---
### 💡 Ideal For
* Spotting **pre-breakout consolidation**
* Identifying **liquidity build-up zones**
* Timing **breakout or expansion trades**
* Enhancing entries with **VWAP, CPR, or session levels**
---
### ✅ Key Features
* Works on **any chart timeframe**
* **Non-repainting**
* Noise-filtered using **wick-to-body logic**
* Simple, clean, and **trader-focused**
Release Notes
🔄 Update Notes- Added body size similarity filter to ensure all four candles have nearly equal body sizes
- Introduced Body Size Tolerance (%) input for fine control over pattern strictness
- Improved pattern quality by filtering out uneven and noisy candle structures
- Enhances detection of true compression and absorption zones
- No repainting behavior changed
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.