Indicator · Pine Script v6 · On the chart

Inversion Fair Value Gaps IFVG ICT Signals

by Ahmed-GoCode· code credited to Ahmed - Quant-Edge Indicators

Calculates and plots ICT Inversion Fair Value Gaps (IFVGs) directly on the price chart.

View on GitHub

GitHub stars53on the repository
Pine versionv6current
Lines of code80
Settings15inputs
LicenceMPL-2.0
Last update2 months ago17 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

80 lines of Pine Script v6 from Quant-Edge-Indicators/Smart Money & Liquidity/FVG.pinescript, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

FVG.pinescript
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Ahmed - Quant-Edge Indicators
//@version=6
indicator("Inversion Fair Value Gaps [TradingFinder] IFVG ICT Signals + Alert" ,'ICT Inversion FVG TFlab', overlay = true, max_bars_back = 5000, max_boxes_count = 500,max_labels_count = 500, max_lines_count = 500 )

//import Libraries
    //import Order Block Drawing  Library
import TFlab/OrderBlockDrawing_TradingFinder/3 as Drawing
    //import FVG  Library
import TFlab/FVGDetectorLibrary/3 as FVG
    //import Alert Sender Library
import TFlab/AlertSenderLibrary_TradingFinder/1 as Alert
    //import Switching Colors Theme
import TFlab/Dark_Light_Theme_TradingFinder_Switching_Colors_Library/1 as SC
//Input
    //Global Setting
ShowAllIFVG = input.bool(true, 'Show All Inversion FVG', group = 'Global Setting')
FVGVaP = input.int(500, 'FVG & IFVG Validity Period (Bar)' , group = 'Logic Parameter' , maxval = 4998 , minval = 10,
 tooltip = 'You can set the validity period of each FVG & IFVG based on the number of candles that have passed since the origin of the Order Block.', group = 'Global Setting')
SCMode = input.string('Light', 'Switching Colors Theme Mode', options = ['Off', 'Light', 'Dark'])
 
    //Inversion Fair Value Gap
PShowDeIFVG = input.bool(true, ' Show Bearish Inversion FVG', group = 'Inversion FVG',inline = 'IDFVG')
PShowSuIFVG = input.bool(true, ' Show Bullish Inversion FVG', group = 'Inversion FVG',inline = 'ISFVG')
OCShowDeIFVG = input.color(#ff52522f, '', group = 'Inversion FVG',inline = 'IDFVG')
OCShowSuIFVG = input.color(#4caf4f27, '', group = 'Inversion FVG',inline = 'ISFVG')
MLIFVG = input.string('Proximal' , 'Mitigation Level IFVG', ['Proximal', '50 % OB', 'Distal'], 
 tooltip= 'Using this entry, you can determine which level the price reacts to in a Inversion FVG.', group = 'Inversion FVG')



PFVGFilter = input.bool(true, 'FVG Filter ............',  group = 'FVG' , inline = 'FVG Filter')
PFVGFilterType = input.string('Defensive', '', 
 ['Very Aggressive' , 'Aggressive' , 'Defensive' , 'Very Defensive'], group = 'FVG', inline = 'FVG Filter' ,
 tooltip = 'If it is "On", this filter will filter "FVGs" based on the width of the Zone.'  + 
 'From "Very Aggressive" to "Very Defensive" the width of the "FVG" decreases.')


AlertName = input.string('Inversion FVG [TradingFinder]', 'Alerts Name', group = 'Alert')


Alert_IFVG = input.string('On' , 'Alert Inversion FVG Mitigation' , ['On', 'Off'], 'If you turn on the Alert Inversion FVG Mitigation,' +
 'you can receive alerts and notifications after setting the "Alert".' , group = 'Alert')


Frequncy = input.string('Once Per Bar' , 'Message Frequency' , ['All', 'Once Per Bar' , 'Per Bar Close'], 'The triggering frequency. Possible values are: All'+ 
 ' (all function calls trigger the alert), Once Per Bar (the first function call during the bar triggers the alert), ' +  
 ' Per Bar Close (the function call triggers the alert only when it occurs during the last script iteration of the real-time bar,' +  
 ' when it closes). The default is alert.freq_once_per_bar.)', group = 'Alert')
UTC = input.string('UTC' , 'Show Alert time by Time Zone', group = 'Alert')
MoreInfo = input.string('On', 'Display More Info', ['On', 'Off'], group = 'Alert')

/////////////////////////////////
///////////////SCT///////////////
/////////////////////////////////

[CShowDeIFVG] = SC.SwitchingColorMode(OCShowDeIFVG , SCMode)
[CShowSuIFVG] = SC.SwitchingColorMode(OCShowSuIFVG , SCMode)
/////////////////////////////////
///////////////FVG///////////////
/////////////////////////////////

[DConditionFVG, DDFVG, DPFVG, BarDFVG, SConditionFVG, SDFVG, SPFVG, BarSFVG] = FVG.FVGDetector(PFVGFilter ? 'On' : 'Off', PFVGFilterType, false, false)


/////////////////////////////////////
///////////////Drawing///////////////
/////////////////////////////////////

    //OUTPUT ==> Alert Trigger
[Alert_DFVG, Alert_DIFVG] = Drawing.OBDrawing('Demand', DConditionFVG,DDFVG, DPFVG, BarDFVG, true, FVGVaP, MLIFVG, MLIFVG, false , ShowAllIFVG, false, PShowDeIFVG, CShowDeIFVG, CShowDeIFVG)
[Alert_SFVG, Alert_SIFVG] = Drawing.OBDrawing('Supply', SConditionFVG, SDFVG, SPFVG, BarSFVG, true, FVGVaP, MLIFVG, MLIFVG, false, ShowAllIFVG, false, PShowSuIFVG,  CShowSuIFVG, CShowSuIFVG)


///////////////////////////////////
///////////////Alert///////////////
///////////////////////////////////

Alert.AlertSender(Alert_DIFVG  , Alert_IFVG, AlertName, 'Bearish', 'Order Block Signal', 'Full' ,Frequncy, UTC, MoreInfo, 'Short Position in Bearish IFVG', open, high, low, close,0,0,0, DPFVG  , DDFVG)
Alert.AlertSender(Alert_SIFVG  , Alert_IFVG, AlertName, 'Bullish', 'Order Block Signal', 'Full' ,Frequncy, UTC, MoreInfo, 'Long Position in Bullish IFVG', open, high, low, close,0,0,0, SPFVG  , SDFVG)

Overview

Inversion Fair Value Gaps IFVG ICT Signals detects bullish and bearish fair value gaps and tracks when price passes through them, converting them into inversion zones. Users can customize the validity period in bars, set mitigation level triggers (Proximal, 50%, Distal), apply zone width filtering from aggressive to defensive, and configure custom alert notifications upon zone mitigation.

Details

Published by

Ahmed-GoCode on GitHub

Code credit

Ahmed - Quant-Edge Indicators, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

fair-value-gapfibonaccimarket-structurepine-scriptrsi-strategysmart-money-conceptstechnical-analysistradingviewalgorithmic-tradingcrypto-trading

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Show All Inversion FVGbooltrueShowAllIFVG
FVG & IFVG Validity Period (Bar)int500FVGVaP
Switching Colors Theme ModestringLightSCMode
Show Bearish Inversion FVGbooltruePShowDeIFVG
Show Bullish Inversion FVGbooltruePShowSuIFVG
OCShowDeIFVGcolor#ff52522fOCShowDeIFVG
OCShowSuIFVGcolor#4caf4f27OCShowSuIFVG
Mitigation Level IFVGstringProximalMLIFVG
FVG Filter ............booltruePFVGFilter
PFVGFilterTypestringDefensivePFVGFilterType
Alerts NamestringInversion FVG [TradingFinder]AlertName
Alert Inversion FVG MitigationstringOnAlert_IFVG
Show all 15 settings
SettingTypeDefaultVariable
Message FrequencystringOnce Per BarFrequncy
Show Alert time by Time ZonestringUTCUTC
Display More InfostringOnMoreInfo
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

ICT Equal Highs and Lows

by ArunKBhaskar
575 stars

This overlay indicator finds pivot highs and lows on the price chart and compares the last two highs and the last two lows. When the percentage difference between a pair is below the Equal HL threshold, it treats them as equal levels and draws a box. Left and

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows

DE-tracker

by Allen1212
303 stars

This indicator plots labels on the TradingView price chart to mark ARK Invest's buy and sell trades for the DE stock. Buy transactions appear in green with X1 or X2 multipliers showing the number of ARK ETFs involved on the same day; sells appear in red. The m

Indicator v4 Support & resistanceSMC / ICT / price action
Updated 2 years ago · None stated GitHub repository of DE-tracker

This Pine Script indicator plots a ZigZag on the price chart. It identifies reversal points when price moves more than a set percentage from the last pivot. The script calculates forecasts using zigzag data and labels detected geometric patterns including harm

Indicator v4 TrendSupport & resistance

Golden Bullet Strategy

by TradersPost
218 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 3 months ago · None stated GitHub repository of Golden Bullet Strategy

Open Source Fractal

by cantolab
183 stars

This indicator implements the Fractal Model concept to plot market structure shifts, liquidity sweeps, and Change in State of Delivery (CISD) levels. It overlays custom higher-timeframe candle previews, open prices, and time markers directly on the price chart

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MIT GitHub repository of Open Source Fractal

Swing Failure Signals

by Ganador1
154 stars

This indicator calculates pivot highs and pivot lows to detect liquidity sweeps and Swing Failure Patterns. It identifies when price breaks past recent key swing highs or lows within a configurable historical window, then looks for a quick reversal or change i

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · Apache-2.0 GitHub repository of Swing Failure Signals

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers