OPEN-SOURCE SCRIPT
CUPANG - SMC/RTM Flag Limit [Balanced Smart Filter]

CUPANG - SMC/RTM Flag Limit & Right-Side Volume Profile
1. Overview
CUPANG - SMC/RTM Flag Limit & Volume Profile is an institutional-grade price action indicator built for TradingView in Pine Script v6. It automatically identifies valid Flag Limit (FL / Base Consolidation) formations based on Smart Money Concepts (SMC), Read The Market (RTM), and modern Supply & Demand (SND) principles.
The script automatically draws a built-in replica of TradingView's Long/Short Position Tool (Entry, Dynamic Anti-Spike SL, and R:R Target TP) combined with a real-time Right-Side Volume Profile & Point of Control (POC) histogram.

2. Key Features & Visual Elements
Full Shadow Base FL Box (Wick to Wick): Accurately encloses the entire candle base range from the highest wick to the lowest wick to encapsulate unmitigated institutional order flow.

Auto Long/Short Position Replication:
Bullish Setup (Long): Entry anchored at the High of the Base Zone, Stop Loss buffered below the lower wick with ATR protection, and Target TP projected upward.
Bearish Setup (Short): Entry anchored at the Low of the Base Zone, Stop Loss buffered above the upper wick with ATR protection, and Target TP projected downward.


Right-Side Dynamic Volume Profile:
Displays a horizontal volume distribution histogram across price levels.
Highlights the Point of Control (POC) line representing the heaviest institutional liquidity node.

Single Active Fresh Zone Management:
Prevents clutter by automatically purging stale or mitigated zones whenever a new high-probability FL forms.
3. Quality Scoring & Filtration
The indicator evaluates every detected formation through a multi-factor scoring engine:
Displacement Ratio: Measures the solid body dominance of the breakout candle.
Range Expansion: Compares the explosion candle range against the base candle range.
Trend Alignment: Filters entries using the 50-period EMA baseline.
4. Trading Rules & Execution
Long (Buy) Execution:
- Wait for a FRESH BULLISH FL zone to appear with a quality score $\ge 60\%$.
- Wait for the market to retrace/pull back to the Dashed Entry Line (High of the Base).
- Execute Long: Set Stop Loss at the lower boundary of the Red Box and Take Profit at the upper boundary of the Green Box.
Short (Sell) Execution:
- Wait for a FRESH BEARISH FL zone to appear with a quality score $\ge 60\%$.
- Wait for the market to retrace/pull back to the Dashed Entry Line (Low of the Base).
- Execute Short: Set Stop Loss at the upper boundary of the Red Box and Take Profit at the lower boundary of the Green Box.

Disclaimer: This indicator is designed for technical analysis and educational purposes only. Always apply strict risk management.
1. Overview
CUPANG - SMC/RTM Flag Limit & Volume Profile is an institutional-grade price action indicator built for TradingView in Pine Script v6. It automatically identifies valid Flag Limit (FL / Base Consolidation) formations based on Smart Money Concepts (SMC), Read The Market (RTM), and modern Supply & Demand (SND) principles.
The script automatically draws a built-in replica of TradingView's Long/Short Position Tool (Entry, Dynamic Anti-Spike SL, and R:R Target TP) combined with a real-time Right-Side Volume Profile & Point of Control (POC) histogram.
2. Key Features & Visual Elements
Full Shadow Base FL Box (Wick to Wick): Accurately encloses the entire candle base range from the highest wick to the lowest wick to encapsulate unmitigated institutional order flow.
Auto Long/Short Position Replication:
Bullish Setup (Long): Entry anchored at the High of the Base Zone, Stop Loss buffered below the lower wick with ATR protection, and Target TP projected upward.
Bearish Setup (Short): Entry anchored at the Low of the Base Zone, Stop Loss buffered above the upper wick with ATR protection, and Target TP projected downward.
Right-Side Dynamic Volume Profile:
Displays a horizontal volume distribution histogram across price levels.
Highlights the Point of Control (POC) line representing the heaviest institutional liquidity node.
Single Active Fresh Zone Management:
Prevents clutter by automatically purging stale or mitigated zones whenever a new high-probability FL forms.
3. Quality Scoring & Filtration
The indicator evaluates every detected formation through a multi-factor scoring engine:
Displacement Ratio: Measures the solid body dominance of the breakout candle.
Range Expansion: Compares the explosion candle range against the base candle range.
Trend Alignment: Filters entries using the 50-period EMA baseline.
4. Trading Rules & Execution
Long (Buy) Execution:
- Wait for a FRESH BULLISH FL zone to appear with a quality score $\ge 60\%$.
- Wait for the market to retrace/pull back to the Dashed Entry Line (High of the Base).
- Execute Long: Set Stop Loss at the lower boundary of the Red Box and Take Profit at the upper boundary of the Green Box.
Short (Sell) Execution:
- Wait for a FRESH BEARISH FL zone to appear with a quality score $\ge 60\%$.
- Wait for the market to retrace/pull back to the Dashed Entry Line (Low of the Base).
- Execute Short: Set Stop Loss at the upper boundary of the Red Box and Take Profit at the lower boundary of the Green Box.
Disclaimer: This indicator is designed for technical analysis and educational purposes only. Always apply strict risk management.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน