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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.