OPEN-SOURCE SCRIPT
ICT FVG Buy/Sell Signals

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.
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 ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน