ICT iFVG Detector and Alert [by ote618]

This script detects ICT - fair value gaps (FVG) formed by price gaps between Candle 1 and Candle 3, then monitors the next 5 candles for an inverse fair value gap (iFVG).
What It Detects
Bullish FVG: When Candle 1 high is below Candle 3 low (BISI)
Bearish FVG: When Candle 1 low is above Candle 3 high (SIBI)
Once an FVG is detected, the script checks the next 5 candles:
A Bullish FVG becomes a Bearish IFVG if price closes below Candle 1 high
A Bearish FVG becomes a Bullish IFVG if price closes above Candle 1 low
Only the first bar that validates the FVG triggers the transition to an IFVG.
Visual Output
A shaded rectangle is plotted to mark the original FVG zone (from Candle 1 to Candle 3)
Color-coded:
Red for Bearish IFVG (validated Bullish IG)
Green for Bullish IFVG (validated Bearish IG)
The rectangle extends from Candle 1 to the validating bar
Alerts
You can receive alerts when an FVG becomes an IFVG:
Configurable to fire only on selected timeframes (1m, 5m, 15m, 60m)
Alerts include the direction and the chart timeframe
Settings
Enable Alerts For Timeframe: Choose which timeframe(s) trigger alerts
This tool helps traders identify inverse FVGs (iFVG), a useful ICT concept.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.