OPEN-SOURCE SCRIPT

ICT Setup Detector

414
ICT SETUP DETECTOR (ICT-SD)
A mechanical, bias-gated ICT setup scanner for NQ and ES futures intraday
(built and tuned on the 1-minute chart). It marks liquidity, draws the key
daily/session levels, grades directional bias across three timeframes, and
arms four ICT trade setups with fixed targets, stops, and alerts.

This is an INDICATOR, not a strategy — it places no orders. It draws on the
chart and fires alert() messages so you can act (or forward them to a bot).

------------------------------------------------------------
WHAT IT DRAWS
------------------------------------------------------------
LEVELS
- PDH / PDL — previous day high & low
- Overnight H / L — 18:00 to 09:30 ET range
- Midnight Open (00:00 ET) and RTH Open (09:30 ET)
- ORG — Opening Range Gap zone (prior RTH close to today's RTH open)
- Prior Week H / L

BIAS ENGINE (top-right table)
- Reads three timeframes (default 4H / 1H / 15m) plus the ORG gap state
- Modes: Structure (pivot HH/HL), Momentum (EMA 20 vs 50 + close), or Hybrid
- Produces a gate: "Longs OK", "Shorts OK", or "NO TRADE"
- When the gate is on, setups only arm in the permitted direction

KILLZONES (shaded)
- London 03:00-04:00, NY AM 10:00-11:00, NY PM 14:00-15:00 (NY time, DST-aware)

LIQUIDITY SWEEPS
- BSL/SSL grabs of PDH/PDL/ON H/L (breach within N bars + close back through)
- Red "BSL" / green "SSL" triangles

TRADE SETUPS (each has arm -> entry -> exit with TP / SL / time-stop)
- Silver Bullet — sweep, then FVG + displacement inside a killzone
- OTE — 62-79% fib retrace of a swept leg
- OB+FVG — order-block 50% mitigation behind a displacement FVG
- Sweep Reversal (SR) — simple sweep-and-fade scalp (yellow SR-L / SR-S)

15-MINUTE FVG IDENTIFIER
- 3-bar Fair Value Gaps from the 15m timeframe, drawn on your chart
- Non-repainting (only confirmed/closed 15m candles create a box)
- Teal = bullish gap, red = bearish gap, with a dashed CE (mid) line
- Boxes extend right until price fully fills the gap, then freeze/grey

------------------------------------------------------------
HOW TO USE
------------------------------------------------------------
1. Add to an NQ or ES chart on the 1-minute timeframe (point sizing is
auto-detected from the ticker; other symbols fall back to NQ values).
2. Check the bias table (top-right) for the current gate state before acting.
3. Wait for a setup flag/label to arm in the gate-allowed direction. Each
setup shows its FVG/zone box, dashed entry (CE), dotted stop, dotted TP.
4. Targets default to +20 pts (NQ) / +15 pts (ES). Setups auto-skip when the
required stop is wider than the configured max.
5. To get notified: create an alert on this indicator and choose the
"Any alert() function call" condition. Enable the alert types you want
in the Alerts group (armed / entry / exit / bias-flip / new 15m FVG).

------------------------------------------------------------
KEY SETTINGS
------------------------------------------------------------
- Bias gate on/off, and Bias mode (Structure / Momentum / Hybrid)
- Enable/disable each setup individually
- Displacement filter: x ATR(20) and optional volume-spike requirement
- Sweep breach window (how many bars a wick may lead the close-back)
- Targets and "skip if stop >" caps (per NQ / ES)
- Killzone session times, colors, and visualization toggles
- 15m FVG: timeframe, min gap size, CE line, extend-until-mitigated,
remove-vs-grey on fill, max active gaps, and per-direction colors

TUNING
- Too few signals: set Bias mode to Momentum, turn the bias gate off, or
lower the displacement volume multiplier toward 1.0
- Too many signals: raise Displacement x ATR to ~2.0, raise the volume
multiplier to 1.5-2.0, or raise the minimum FVG size

------------------------------------------------------------
NOTES
------------------------------------------------------------
- Designed for NQ/ES on the 1m chart; other symbols/timeframes are untested.
- Live intrabar markers (especially Sweep Reversal) can update until the bar
closes; all alerts fire on bar close, so alerts are stable.
- Educational tool. Not financial advice. Test before trading live.
```

Want me to:
- **Trim it to a short version** (a few lines) for the tooltip/one-liner, or
- **Save it to a file** in the repo (e.g. `pine/ICT-SD-description.txt`) alongside the source?

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.