OPEN-SOURCE SCRIPT
Svopex FVG

Svopex FVG — multi-timeframe Fair Value Gaps with flexible mitigation
Detects and plots Fair Value Gaps (3-candle price imbalances) from any timeframe you choose, with full control over when a gap is considered "closed". Built on
twingall's original FVG indicator (MPL 2.0), extended for higher-timeframe detection and more granular fill logic.
How FVGs are detected
A bullish (Up) FVG forms when high[3] < low[1] — i.e. candle −3's high is below candle −1's low, leaving an unfilled gap between them. A bearish (Down) FVG is the
mirror case: low[3] > high[1]. Detection happens on the Zone timeframe you pick, not the chart timeframe, so you can view HTF gaps while trading a lower timeframe.
Detection is non-repainting — only closed HTF candles are used (via request.security with lookahead_off and a 1-bar shift).
Zone timeframe
Two ways to control which timeframe drives detection. Either set the Zone timeframe explicitly (default 1H), or flip the "Use chart timeframe" toggle — when on, the
indicator automatically follows the chart's current timeframe, so switching your chart from 1H to 15M also switches the displayed FVGs. The Zone timeframe input is
ignored while the toggle is on, but stays available as a fallback.
Fill threshold
Controls when a gap stops extending to the right. A single slider (0–100%) replaces the older "Use CE vs Full Fill" toggle. Set it to 100 and the FVG remains active
until price fully closes the gap. Set it to 50 and it closes at the midline (equivalent to a CE / Consequent Encroachment touch). Set it to 0 and any penetration of
the gap's near edge counts as a hit. Any value in between works — e.g. 70 means the FVG ends when price has filled 70% of its height.
Include wick
Decides what price data drives the fill check. When off (default, body-only), the gap only closes if the candle's body (max/min of open/close) crosses the threshold —
intrabar wicks are ignored. When on, wicks count too (strict mode): a long shadow through the gap is enough to close it.
Visuals
Up FVGs render in green, Down FVGs in red, both at 80% transparency by default — matching the Svopex Supply & Demand Zones indicator for visual consistency if you use
both. Colors are user-configurable. Optional "delete filled boxes" fully hides mitigated gaps instead of just freezing them. A lookback (in days) controls how far back
fresh FVGs are allowed to be drawn.
Alerts
Six alert conditions are exposed. "ABOVE/BELOW threshold" fires when price crosses the fill threshold of the latest active FVG in each direction — useful for CE
rejections or full-fill confirmations. "IOFED into latest active Up/Down FVG" fires when price first enters the gap at its near edge, regardless of the fill threshold
setting. "Simple alert: Up/Down FVG (confirmed)" fires the moment a fresh FVG forms on the chosen HTF.
Settings summary
Lookback in days, Use chart timeframe toggle, Zone timeframe (default 60), Up/Down FVG visibility and colors, Delete filled boxes, Fill threshold percent (default 50),
Include wick.
Based on the original FVG indicator by twingall (MPL 2.0). Extensions by Petr Svoboda: removed legacy CE display, replaced the CE-vs-Full-Fill toggle with a
continuous fill percent, added HTF detection via request.security, added the chart-TF auto-follow toggle, aligned default colors with Svopex Supply & Demand Zones.
Detects and plots Fair Value Gaps (3-candle price imbalances) from any timeframe you choose, with full control over when a gap is considered "closed". Built on
twingall's original FVG indicator (MPL 2.0), extended for higher-timeframe detection and more granular fill logic.
How FVGs are detected
A bullish (Up) FVG forms when high[3] < low[1] — i.e. candle −3's high is below candle −1's low, leaving an unfilled gap between them. A bearish (Down) FVG is the
mirror case: low[3] > high[1]. Detection happens on the Zone timeframe you pick, not the chart timeframe, so you can view HTF gaps while trading a lower timeframe.
Detection is non-repainting — only closed HTF candles are used (via request.security with lookahead_off and a 1-bar shift).
Zone timeframe
Two ways to control which timeframe drives detection. Either set the Zone timeframe explicitly (default 1H), or flip the "Use chart timeframe" toggle — when on, the
indicator automatically follows the chart's current timeframe, so switching your chart from 1H to 15M also switches the displayed FVGs. The Zone timeframe input is
ignored while the toggle is on, but stays available as a fallback.
Fill threshold
Controls when a gap stops extending to the right. A single slider (0–100%) replaces the older "Use CE vs Full Fill" toggle. Set it to 100 and the FVG remains active
until price fully closes the gap. Set it to 50 and it closes at the midline (equivalent to a CE / Consequent Encroachment touch). Set it to 0 and any penetration of
the gap's near edge counts as a hit. Any value in between works — e.g. 70 means the FVG ends when price has filled 70% of its height.
Include wick
Decides what price data drives the fill check. When off (default, body-only), the gap only closes if the candle's body (max/min of open/close) crosses the threshold —
intrabar wicks are ignored. When on, wicks count too (strict mode): a long shadow through the gap is enough to close it.
Visuals
Up FVGs render in green, Down FVGs in red, both at 80% transparency by default — matching the Svopex Supply & Demand Zones indicator for visual consistency if you use
both. Colors are user-configurable. Optional "delete filled boxes" fully hides mitigated gaps instead of just freezing them. A lookback (in days) controls how far back
fresh FVGs are allowed to be drawn.
Alerts
Six alert conditions are exposed. "ABOVE/BELOW threshold" fires when price crosses the fill threshold of the latest active FVG in each direction — useful for CE
rejections or full-fill confirmations. "IOFED into latest active Up/Down FVG" fires when price first enters the gap at its near edge, regardless of the fill threshold
setting. "Simple alert: Up/Down FVG (confirmed)" fires the moment a fresh FVG forms on the chosen HTF.
Settings summary
Lookback in days, Use chart timeframe toggle, Zone timeframe (default 60), Up/Down FVG visibility and colors, Delete filled boxes, Fill threshold percent (default 50),
Include wick.
Based on the original FVG indicator by twingall (MPL 2.0). Extensions by Petr Svoboda: removed legacy CE display, replaced the CE-vs-Full-Fill toggle with a
continuous fill percent, added HTF detection via request.security, added the chart-TF auto-follow toggle, aligned default colors with Svopex Supply & Demand Zones.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.