OPEN-SOURCE SCRIPT
ICT/SMC HUD

Overview
This indicator is an ICT/SMC-inspired market structure tool that detects:
Swing Structure (pivot-based)
BOS (Break of Structure) and CHoCH (Change of Character)
Liquidity Sweeps (buy-side & sell-side)
Premium/Discount filter using a simple equilibrium (EQ) midpoint
A Hold Score (0–5) system calculated from a higher timeframe (HTF)
Optional TP/SL visualization box (with TP2 expansion when Hold Score is strong)
⚠️ This is an educational tool, not a guaranteed trading system.
Core Logic (Where signals come from)
This script builds a simplified ICT/SMC framework using 3 layers:
1) Market Structure via Swings (Pivot High/Low)
The script finds swing highs/lows using:
ta.pivothigh(high, swingLen, swingLen)
ta.pivotlow(low, swingLen, swingLen)
These swings become the reference points for structure breaks.
2) BOS / CHoCH Detection
BOS Up = price closes above the last swing high
BOS Down = price closes below the last swing low
trend updates to 1 (bullish) or -1 (bearish) based on BOS
CHoCH triggers when BOS occurs against the current trend
CHoCH Up = trend was bearish, then BOS Up happens
CHoCH Down = trend was bullish, then BOS Down happens
3) Liquidity Sweep + Premium/Discount Filter
Sell-side sweep: low breaks below last swing low, but closes back above it
Buy-side sweep: high breaks above last swing high, but closes back below it
Equilibrium (EQ) midpoint is:
(lastSwingHigh + lastSwingLow) / 2
Discount = price below EQ
Premium = price above EQ
Signal Rules (Buy / Sell)
Buy Signal
Sell-side sweep + (CHoCH Up or BOS Up)
OR
BOS Up while price is in Discount
Sell Signal
Buy-side sweep + (CHoCH Down or BOS Down)
OR
BOS Down while price is in Premium
Hold Score System (0–5) — HTF confirmation
The script calculates a Hold Score from HTF using 5 checks:
HTF EMA Bias
Bullish hold bias: EMA Fast > EMA Mid
Bearish hold bias: EMA Fast < EMA Mid
Volatility Expansion
Uses HTF Bollinger Band width; if width is increasing, expansion is “OK”
Mid Acceptance
HTF close relative to HTF BB basis (SMA)
Follow-through after Entry
Requires N consecutive bars closing in favor of the entry direction
No Opposite Break
Avoid holding if opposite BOS/CHoCH appears
Hold Score = sum of the 5 checks (0–5)
TP/SL Box (Optional)
When a new Buy/Sell signal occurs:
Entry is set at current close
SL uses:
Swing-based stop (lowest/ highest of last N bars)
optional ATR buffer
TP1 and TP2 are set using Risk:Reward ratios
TP2 Expansion (Optional)
If Hold Score ≥ threshold:
TP2 RR increases by extraRRonHold
Can be set to expand only (never shrink)
Auto-hide TP/SL Drawings (Optional)
If enabled, the TP/SL box/lines/labels will automatically disappear after N bars.
This is useful for clean charts while still keeping Hold Score logic running.
Best Use Cases
✅ Works best during liquidity sessions:
London Killzone
New York Killzone
✅ Recommended timeframes:
Structure: 15m / 1h
Entry refinement: 5m / 1m
Hold Score HTF: 1h or 4h
Inputs Guide (Quick)
Swing length (Structure): controls swing sensitivity (higher = fewer swings)
Hold Score HTF: HTF used for Hold Score confirmation
TP/SL Box: visualization tool, not order execution
Auto-hide: removes drawings after N bars for clean charts
TP2 Expand: increases TP2 target when Hold Score is strong
Disclaimer
This indicator does not place trades and does not guarantee profits. Always manage risk, backtest, and validate with your own strategy.
This indicator is an ICT/SMC-inspired market structure tool that detects:
Swing Structure (pivot-based)
BOS (Break of Structure) and CHoCH (Change of Character)
Liquidity Sweeps (buy-side & sell-side)
Premium/Discount filter using a simple equilibrium (EQ) midpoint
A Hold Score (0–5) system calculated from a higher timeframe (HTF)
Optional TP/SL visualization box (with TP2 expansion when Hold Score is strong)
⚠️ This is an educational tool, not a guaranteed trading system.
Core Logic (Where signals come from)
This script builds a simplified ICT/SMC framework using 3 layers:
1) Market Structure via Swings (Pivot High/Low)
The script finds swing highs/lows using:
ta.pivothigh(high, swingLen, swingLen)
ta.pivotlow(low, swingLen, swingLen)
These swings become the reference points for structure breaks.
2) BOS / CHoCH Detection
BOS Up = price closes above the last swing high
BOS Down = price closes below the last swing low
trend updates to 1 (bullish) or -1 (bearish) based on BOS
CHoCH triggers when BOS occurs against the current trend
CHoCH Up = trend was bearish, then BOS Up happens
CHoCH Down = trend was bullish, then BOS Down happens
3) Liquidity Sweep + Premium/Discount Filter
Sell-side sweep: low breaks below last swing low, but closes back above it
Buy-side sweep: high breaks above last swing high, but closes back below it
Equilibrium (EQ) midpoint is:
(lastSwingHigh + lastSwingLow) / 2
Discount = price below EQ
Premium = price above EQ
Signal Rules (Buy / Sell)
Buy Signal
Sell-side sweep + (CHoCH Up or BOS Up)
OR
BOS Up while price is in Discount
Sell Signal
Buy-side sweep + (CHoCH Down or BOS Down)
OR
BOS Down while price is in Premium
Hold Score System (0–5) — HTF confirmation
The script calculates a Hold Score from HTF using 5 checks:
HTF EMA Bias
Bullish hold bias: EMA Fast > EMA Mid
Bearish hold bias: EMA Fast < EMA Mid
Volatility Expansion
Uses HTF Bollinger Band width; if width is increasing, expansion is “OK”
Mid Acceptance
HTF close relative to HTF BB basis (SMA)
Follow-through after Entry
Requires N consecutive bars closing in favor of the entry direction
No Opposite Break
Avoid holding if opposite BOS/CHoCH appears
Hold Score = sum of the 5 checks (0–5)
TP/SL Box (Optional)
When a new Buy/Sell signal occurs:
Entry is set at current close
SL uses:
Swing-based stop (lowest/ highest of last N bars)
optional ATR buffer
TP1 and TP2 are set using Risk:Reward ratios
TP2 Expansion (Optional)
If Hold Score ≥ threshold:
TP2 RR increases by extraRRonHold
Can be set to expand only (never shrink)
Auto-hide TP/SL Drawings (Optional)
If enabled, the TP/SL box/lines/labels will automatically disappear after N bars.
This is useful for clean charts while still keeping Hold Score logic running.
Best Use Cases
✅ Works best during liquidity sessions:
London Killzone
New York Killzone
✅ Recommended timeframes:
Structure: 15m / 1h
Entry refinement: 5m / 1m
Hold Score HTF: 1h or 4h
Inputs Guide (Quick)
Swing length (Structure): controls swing sensitivity (higher = fewer swings)
Hold Score HTF: HTF used for Hold Score confirmation
TP/SL Box: visualization tool, not order execution
Auto-hide: removes drawings after N bars for clean charts
TP2 Expand: increases TP2 target when Hold Score is strong
Disclaimer
This indicator does not place trades and does not guarantee profits. Always manage risk, backtest, and validate with your own strategy.
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.