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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。