OPEN-SOURCE SCRIPT
stelaraX - Fair Value Gap

stelaraX – Fair Value Gap
stelaraX – Fair Value Gap is a technical analysis indicator designed to detect, visualize, and manage Fair Value Gaps (FVGs) using a strict three-candle imbalance model. The script identifies bullish and bearish gaps, draws them as zones on the chart, and tracks their mitigation status over time.
For advanced AI-based chart analysis and automated structure interpretation, visit stelarax.com
Core logic
The indicator detects Fair Value Gaps using a three-bar condition:
* bullish FVG when the current low is above the high from two bars ago
* bearish FVG when the current high is below the low from two bars ago
Detected gaps are filtered using minimum size requirements:
* minimum size in ticks
* minimum size as a percentage of price
Each FVG stores its top and bottom boundaries, its midpoint level (Consequent Encroachment), the creation bar, and its current state.
Consequent Encroachment and mitigation
The script can optionally plot the Consequent Encroachment (CE) level, defined as the midpoint of the gap.
Mitigation tracking is supported and can be defined as:
* Touch
* 50 percent retracement to the CE level
* Full fill of the gap
When mitigation occurs, the FVG can:
* remain visible in a mitigated state
* be deleted automatically
* stop extending and close at the mitigation bar
Mitigation styling uses a dedicated color scheme to clearly separate active and mitigated gaps.
Visualization
FVGs are drawn directly on the chart as colored zones:
* bullish FVGs are displayed in green tones
* bearish FVGs are displayed in red tones
Optional features include:
* CE level line with configurable line style
* FVG labels
* automatic extension of active gaps
* configurable maximum age and maximum number of displayed gaps
All colors and display settings are fully customizable.
Dashboard
An optional on-chart dashboard provides a real-time overview of:
* total bullish and bearish FVGs
* mitigated bullish and bearish FVGs
* active (unmitigated) FVGs
* mitigation percentages
Dashboard position and text size are configurable.
Alerts
Alert conditions are available for:
* newly detected bullish FVGs
* newly detected bearish FVGs
Additional real-time alerts can be triggered when an FVG is mitigated.
Use case
This indicator is intended for:
* imbalance and fair value gap mapping
* identifying potential reaction zones and retracement areas
* tracking gap mitigation behavior over time
* multi-timeframe confluence analysis
For a fully automated AI-driven chart analysis solution, additional tools and insights are available at stelarax.com
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
stelaraX – Fair Value Gap is a technical analysis indicator designed to detect, visualize, and manage Fair Value Gaps (FVGs) using a strict three-candle imbalance model. The script identifies bullish and bearish gaps, draws them as zones on the chart, and tracks their mitigation status over time.
For advanced AI-based chart analysis and automated structure interpretation, visit stelarax.com
Core logic
The indicator detects Fair Value Gaps using a three-bar condition:
* bullish FVG when the current low is above the high from two bars ago
* bearish FVG when the current high is below the low from two bars ago
Detected gaps are filtered using minimum size requirements:
* minimum size in ticks
* minimum size as a percentage of price
Each FVG stores its top and bottom boundaries, its midpoint level (Consequent Encroachment), the creation bar, and its current state.
Consequent Encroachment and mitigation
The script can optionally plot the Consequent Encroachment (CE) level, defined as the midpoint of the gap.
Mitigation tracking is supported and can be defined as:
* Touch
* 50 percent retracement to the CE level
* Full fill of the gap
When mitigation occurs, the FVG can:
* remain visible in a mitigated state
* be deleted automatically
* stop extending and close at the mitigation bar
Mitigation styling uses a dedicated color scheme to clearly separate active and mitigated gaps.
Visualization
FVGs are drawn directly on the chart as colored zones:
* bullish FVGs are displayed in green tones
* bearish FVGs are displayed in red tones
Optional features include:
* CE level line with configurable line style
* FVG labels
* automatic extension of active gaps
* configurable maximum age and maximum number of displayed gaps
All colors and display settings are fully customizable.
Dashboard
An optional on-chart dashboard provides a real-time overview of:
* total bullish and bearish FVGs
* mitigated bullish and bearish FVGs
* active (unmitigated) FVGs
* mitigation percentages
Dashboard position and text size are configurable.
Alerts
Alert conditions are available for:
* newly detected bullish FVGs
* newly detected bearish FVGs
Additional real-time alerts can be triggered when an FVG is mitigated.
Use case
This indicator is intended for:
* imbalance and fair value gap mapping
* identifying potential reaction zones and retracement areas
* tracking gap mitigation behavior over time
* multi-timeframe confluence analysis
For a fully automated AI-driven chart analysis solution, additional tools and insights are available at stelarax.com
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.