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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.