OPEN-SOURCE SCRIPT
IFVG Extended (simple)

This is an indicator that identifies and visualizes Inverted Fair Value Gaps (IFVG) on price charts. Here's what it does:
Core Functionality
Fair Value Gap (FVG) Detection:
Identifies bullish FVGs when current low is above the high from 2 bars ago
Identifies bearish FVGs when current high is below the low from 2 bars ago
Filters gaps using an ATR-based minimum size threshold
Inversion Tracking:
Monitors when price breaks back through identified FVGs (inversions)
Tracks the state transition from FVG to inverted FVG
Generates signals when price reacts to inverted zones
Key Features
Visual Elements:
Displays up to 500 boxes, lines, and labels on the chart
Shows the last N FVGs (configurable, default 5)
Color-coded zones: green for bullish, red for bearish
Dashed midlines through each gap
Triangle markers (▲/▼) indicating signal triggers
User Inputs:
Show Last: Number of recent IFVGs to display (1-100)
Signal Preference: Choose between "Close" or "Wick" for signal detection
ATR Multiplier: Minimum gap size filter (0.25 default)
Customizable colors for bull/bear zones and midlines
Signal Logic:
Bullish signal: Price closes above inverted bearish FVG after previously breaking below it
Bearish signal: Price closes below inverted bullish FVG after previously breaking above it
Includes alertconditions for automated notifications
Technical Implementation
Uses custom types (fvg and lab) to store gap data, manages arrays of active and inverted FVGs, and dynamically redraws all visual elements on the last bar to maintain clean chart presentation.
Core Functionality
Fair Value Gap (FVG) Detection:
Identifies bullish FVGs when current low is above the high from 2 bars ago
Identifies bearish FVGs when current high is below the low from 2 bars ago
Filters gaps using an ATR-based minimum size threshold
Inversion Tracking:
Monitors when price breaks back through identified FVGs (inversions)
Tracks the state transition from FVG to inverted FVG
Generates signals when price reacts to inverted zones
Key Features
Visual Elements:
Displays up to 500 boxes, lines, and labels on the chart
Shows the last N FVGs (configurable, default 5)
Color-coded zones: green for bullish, red for bearish
Dashed midlines through each gap
Triangle markers (▲/▼) indicating signal triggers
User Inputs:
Show Last: Number of recent IFVGs to display (1-100)
Signal Preference: Choose between "Close" or "Wick" for signal detection
ATR Multiplier: Minimum gap size filter (0.25 default)
Customizable colors for bull/bear zones and midlines
Signal Logic:
Bullish signal: Price closes above inverted bearish FVG after previously breaking below it
Bearish signal: Price closes below inverted bullish FVG after previously breaking above it
Includes alertconditions for automated notifications
Technical Implementation
Uses custom types (fvg and lab) to store gap data, manages arrays of active and inverted FVGs, and dynamically redraws all visual elements on the last bar to maintain clean chart presentation.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.