OPEN-SOURCE SCRIPT
HTF Control Shift + Prev Candle Break Sequence

🧭 HTF Control Shift + Previous Candle Break Sequence
Overview
The HTF Control Shift + Previous Candle Break Sequence indicator identifies high-probability shift candles that suggest a potential change in market control — from sellers to buyers or vice versa — and then tracks whether price confirms that shift by breaking the previous candle’s high or low.
This tool is designed to help traders detect institutional control shifts and confirm them with price structure breaks, providing a framework for spotting early trend reversals or strong continuation moves.
How It Works
Control Shift Candle Detection
A Bullish Control Shift occurs when a candle shows:
A long lower wick (≥ Wick % Threshold of total range).
A close near the high (within Body % Threshold of the top).
A Bearish Control Shift occurs when a candle shows:
A long upper wick (≥ Wick % Threshold of total range).
A close near the low (within Body % Threshold of the bottom).
These candles are highlighted in green (bullish) or red (bearish), and optionally labeled on the chart.
Previous Candle High/Low Tracking
The script automatically plots horizontal lines at the previous candle’s high (green) and low (red).
These act as key reference levels for breakout confirmation.
Breakout Confirmation Sequence
A Bullish Sequence triggers when a Bullish Control Shift candle is followed by a break above the previous candle’s high.
A Bearish Sequence triggers when a Bearish Control Shift candle is followed by a break below the previous candle’s low.
When either sequence completes, the indicator can send a TradingView alert confirming the directional breakout.
How to Use
Timeframe:
Optimized for higher timeframes (1H, 4H, Daily) to filter out intraday noise and identify structural market shifts.
Trend Reversal Identification:
Watch for Control Shift candles at major highs/lows, order blocks, or liquidity zones — a confirmed breakout often signals a trend reversal or new directional push.
Continuation Confirmation:
In trending markets, a Control Shift candle that breaks in the direction of trend can validate a strong continuation setup.
Alert Usage:
Set alerts for:
Bullish Control Shift Confirmed Breakout
Bearish Control Shift Confirmed Breakdown
Optional: raw Control Shift or Break alerts.
Customization
Wick % Threshold: Adjusts the required wick size to define a control shift.
Body % Threshold: Controls how close the close must be to the high/low for confirmation.
Label Toggle: Optionally display labels only on control shift candles.
Best Practices
Combine with higher-timeframe trend filters.
Avoid using it alone in tight consolidation zones.
Strongest signals occur when:
Control Shift appears at key structure levels.
The breakout bar closes firmly beyond the previous high/low.
Volume supports the breakout.
Summary
✅ Detects when market control flips (buyers ↔ sellers).
✅ Confirms shift with breakout above/below previous candle.
✅ Ideal for 1H–4H swing or position trading.
✅ Provides visual, structural, and alert-based confirmation.
Overview
The HTF Control Shift + Previous Candle Break Sequence indicator identifies high-probability shift candles that suggest a potential change in market control — from sellers to buyers or vice versa — and then tracks whether price confirms that shift by breaking the previous candle’s high or low.
This tool is designed to help traders detect institutional control shifts and confirm them with price structure breaks, providing a framework for spotting early trend reversals or strong continuation moves.
How It Works
Control Shift Candle Detection
A Bullish Control Shift occurs when a candle shows:
A long lower wick (≥ Wick % Threshold of total range).
A close near the high (within Body % Threshold of the top).
A Bearish Control Shift occurs when a candle shows:
A long upper wick (≥ Wick % Threshold of total range).
A close near the low (within Body % Threshold of the bottom).
These candles are highlighted in green (bullish) or red (bearish), and optionally labeled on the chart.
Previous Candle High/Low Tracking
The script automatically plots horizontal lines at the previous candle’s high (green) and low (red).
These act as key reference levels for breakout confirmation.
Breakout Confirmation Sequence
A Bullish Sequence triggers when a Bullish Control Shift candle is followed by a break above the previous candle’s high.
A Bearish Sequence triggers when a Bearish Control Shift candle is followed by a break below the previous candle’s low.
When either sequence completes, the indicator can send a TradingView alert confirming the directional breakout.
How to Use
Timeframe:
Optimized for higher timeframes (1H, 4H, Daily) to filter out intraday noise and identify structural market shifts.
Trend Reversal Identification:
Watch for Control Shift candles at major highs/lows, order blocks, or liquidity zones — a confirmed breakout often signals a trend reversal or new directional push.
Continuation Confirmation:
In trending markets, a Control Shift candle that breaks in the direction of trend can validate a strong continuation setup.
Alert Usage:
Set alerts for:
Bullish Control Shift Confirmed Breakout
Bearish Control Shift Confirmed Breakdown
Optional: raw Control Shift or Break alerts.
Customization
Wick % Threshold: Adjusts the required wick size to define a control shift.
Body % Threshold: Controls how close the close must be to the high/low for confirmation.
Label Toggle: Optionally display labels only on control shift candles.
Best Practices
Combine with higher-timeframe trend filters.
Avoid using it alone in tight consolidation zones.
Strongest signals occur when:
Control Shift appears at key structure levels.
The breakout bar closes firmly beyond the previous high/low.
Volume supports the breakout.
Summary
✅ Detects when market control flips (buyers ↔ sellers).
✅ Confirms shift with breakout above/below previous candle.
✅ Ideal for 1H–4H swing or position trading.
✅ Provides visual, structural, and alert-based confirmation.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.