OPEN-SOURCE SCRIPT

ICT FVG Buy/Sell Signals

213
This bot is built on ICT (Inner Circle Trader) concepts such as:

Fair Value Gaps (FVGs) – imbalance zones between candles.

Consequent Encroachment (CE) – the midpoint of a gap.

Premium / Discount Arrays – dealing ranges split into premium (sell-side) and discount (buy-side) zones.

Displacement candles – strong impulsive moves that confirm intent.

The bot scans for FVGs, marks CE levels, and waits for price to return to these levels.
When price revisits a valid FVG zone with displacement confirmation and in the correct PD array, the bot generates a BUY or SELL signal.

✅ Signal Rules

Buy Signal

Price trades back into a Bullish FVG.

Current bar shows bullish displacement (large bullish body relative to ATR).

Price is in discount territory of the current dealing range (if PD filter is enabled).

Close is above the CE line of the FVG.

Sell Signal

Price trades back into a Bearish FVG.

Current bar shows bearish displacement.

Price is in premium territory of the current dealing range.

Close is below the CE line of the FVG.

🎯 What You’ll See on the Chart

Green “BUY” labels below candles when long signals trigger.

Red “SELL” labels above candles when short signals trigger.

Shaded background:

Red = Premium zone (sell side).

Teal = Discount zone (buy side).

Yellow line = dealing range midpoint (equilibrium).

Dots on CE lines = midpoints of the latest bullish/bearish FVG.

🔔 Alerts

ICT Buy → Triggers when a bullish setup confirms.

ICT Sell → Triggers when a bearish setup confirms.

You can connect these alerts to:

TradingView notifications.

Webhooks (for brokers or bots like MetaTrader, NinjaTrader, or Discord).

⚙️ Settings

Swing length – how many bars to use when detecting swing highs/lows for the dealing range.

Use PD filter – toggle ON/OFF for requiring discount/premium alignment.

Displacement ATR multiple – how strong the candle body must be compared to ATR to count as a displacement.

ATR length – used for displacement filter.

📈 Supported Markets

Works on all symbols and timeframes.
Commonly applied to:

NASDAQ (NQ, QQQ)

S&P500 (ES, SPX, SPY)

Forex pairs

Crypto (BTC, ETH, etc.)

⚠️ Disclaimer

This bot is for educational purposes only. It does not guarantee profits and should be tested on demo accounts first.
Always apply proper risk management before trading live.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.