PROTECTED SOURCE SCRIPT
מעודכן

LTF FVG + IFVG Extractor

23
Short description
Minimalist tool that tracks low-timeframe Fair Value Gaps (FVGs) and their inversions (IFVGs).
It keeps all IFVGs on the chart and always highlights the nearest bullish FVG below price and the nearest bearish FVG above price.

What it does

Detects standard 3-bar LTF FVGs (same logic as ICT-style 3-candle gaps).

Tracks when an FVG is inverted (price closes through the opposite side of the gap) and creates a persistent IFVG zone.

Freezes the original FVG when it’s broken or expired, so the “parent” level stays visible for context.

Among all still-active LTF FVGs it:

Highlights the closest bearish FVG above current price.

Highlights the closest bullish FVG below current price.

All IFVGs and frozen FVGs stay on the chart (up to the configured limit) so you can study how price respects old liquidity gaps.

Key features

LTF timeframe override – use chart timeframe or specify a custom LTF (e.g. 1m on a 5m chart).

Lifetime model for FVGs – gap lifetime in bars is derived from timeframe (shorter on low TF, longer on high TF).

Inversion logic (IFVG)

Only inverts FVGs that are younger than Source LTF FVG Max Age.

IFVGs are drawn with fixed bar length (LTF Inverted FVG Length) and do not repaint.

Frozen parent FVGs

When a live FVG is broken or expires, it’s turned into a static “historical” zone and kept on the chart.

Load control

Max IFVG boxes kept to avoid hitting TradingView’s object limits.

Inputs (high level)

LTF Timeframe Override – leave blank to use chart, or set eg. 1 or 5.

Bullish / Bearish LTF Zone Color – colors for “live” LTF gaps.

LTF Inverted FVG Length (bars) – how long newly created IFVGs extend in bars.

LTF Inverted FVG Color – color for IFVGs.

Only Invert If Source Younger Than N Bars / Source LTF FVG Max Age – age filter for which FVGs are allowed to invert.

Max IFVG boxes kept – cap on how many IFVG boxes are stored and displayed.

How to use it

Put the script on your LTF chart or higher timeframe with an LTF override.

Use the highlighted bearish FVG above and bullish FVG below as the current closest “liquidity magnets”.

Use the IFVGs + frozen parent FVGs as historical context for where price previously left and reclaimed imbalances.

This script is designed as a clean FVG/IFVG layer that you can stack with your own OB, VWAP or session tools without clutter from anything else.
הערות שחרור
Colour changed on bullish fvg.
הערות שחרור
Bug Fix:
Inverted FVG (IFVG) boxes now stop correctly when price breaks through them a second time. On the second break, the right edge of the IFVG is clipped to the break bar and the zone no longer extends forward, while still remaining visible on the chart. Previously, IFVGs could keep stretching into the future and clutter the view.
הערות שחרור
New chart.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.