OPEN-SOURCE SCRIPT
Colidation Breakout Structure(HA-CBS)

Overview
Most breakout indicators suffer from "noise," reacting to every minor price movement and producing frequent fakeouts. HA-CBS solves this by utilizing Heikin-Ashi (HA) smoothing and Swing Point analysis to isolate periods of extreme energy accumulation (Consolidation) and verifying the subsequent breakout with Fair Value Gaps (FVG).
⚠️ Usage Note: This script is strictly optimized for Heikin-Ashi charts. The core logic relies on Heikin-Ashi body (Open/Close) calculations. To ensure the signals align perfectly with the price action you see, please switch your chart type to Heikin-Ashi.
How it Works: The HA-CBS Logic
Unlike generic indicators that draw signals instantly, HA-CBS follows a rigorous three-step verification process to ensure market displacement is real:
Key Features
Trading Strategy
Most breakout indicators suffer from "noise," reacting to every minor price movement and producing frequent fakeouts. HA-CBS solves this by utilizing Heikin-Ashi (HA) smoothing and Swing Point analysis to isolate periods of extreme energy accumulation (Consolidation) and verifying the subsequent breakout with Fair Value Gaps (FVG).
⚠️ Usage Note: This script is strictly optimized for Heikin-Ashi charts. The core logic relies on Heikin-Ashi body (Open/Close) calculations. To ensure the signals align perfectly with the price action you see, please switch your chart type to Heikin-Ashi.
How it Works: The HA-CBS Logic
Unlike generic indicators that draw signals instantly, HA-CBS follows a rigorous three-step verification process to ensure market displacement is real:
- Structural Mapping: Using a multi-term swing point algorithm, the script identifies key supply and demand boundaries.
- Consolidation Counting (The "Coil"): The script measures how many consecutive Heikin-Ashi bodies remain "tucked" within the structural range. A built-in CANDLE_MARGIN_RATE ensures that insignificant doji-like candles don't disrupt the count. The longer the "coil," the higher the potential for an explosive breakout.
- Kinetic Validation (FVG): When price finally breaks the structural boundary, the script checks for a Fair Value Gap. An FVG-backed breakout confirms that institutional "Impulse" is present, distinguishing a genuine trend start from a mere stop-run.
Key Features
- Impulse Filter: Filters out low-momentum movements by requiring an FVG at the moment of the structural break.
- HA-Body Precision: Focuses on the "core" of the candle, ignoring volatile wicks that often lead to false signals.
- Multi-Term Flexibility: Users can toggle between Short, Intermediate, and Long-term swing structures to suit scalping, day trading, or swing trading.
- Recent Candidate Mode: Use the Recent Only toggle to keep your chart clean by only displaying the most recent and relevant breakout candidate for each structure.
Trading Strategy
- Strategy A: The Impulse Entry (Aggressive)
Enter the trade as soon as the HA-CBS signal is confirmed (HA Close breaks the structure with an FVG). This captures the immediate momentum as a new supply/demand imbalance is established. - Strategy B: The Mitigation Entry (Conservative)
Wait for price to return (retrace) to the identified HA-CBS Block. Institutional players often "mitigate" their positions by returning to the breakout source. This approach typically offers a higher Risk/Reward ratio.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.