FVG Maxing - Fair Value Gaps, Equilibrium, and Candle Patterns
What this script does
This open-source indicator highlights 3-candle fair value gaps (FVGs) on the active chart timeframe, draws their midpoint ("equilibrium") line, tracks when each gap is mitigated, and optionally marks simple candle patterns (engulfing and doji) for confluence. It is intended as an educational tool to study how price interacts with imbalances.
3-candle bullish and bearish FVG zones drawn as forward-extending boxes.
Equilibrium line at 50% of each gap.
Different styling for mitigated vs unmitigated gaps.
Compact statistics panel showing how many gaps are currently active and filled.
Optional overlays for bullish/bearish engulfing patterns and doji candles.
1. FVG logic (3-candle gaps)
The script focuses on a strict 3-candle definition of a fair value gap:
Three consecutive candles with the same body direction.
The wick of candle 3 is separated from the wick of candle 1 (no overlap).
A bullish gap is created when price moves up fast enough to leave a gap between candle 1 and 3. A bearish gap is the mirror case to the downside.
In Pine, the core detection looks like this:
// Three candles with the same body direction
bull_seq = close > open and close > open and close > open
bear_seq = close < open and close < open and close < open
// Wick gap between candle 1 and candle 3
bull_gap = bull_seq and low > high
bear_gap = bear_seq and high < low
// Final FVG flags
is_bull_fvg = bull_gap
is_bear_fvg = bear_gap
For each detected FVG:
Bullish FVG range: from high up to low (gap below current price).
Bearish FVG range: from low down to high (gap above current price).
Each zone is stored in a custom FVGData structure so it can be updated when price later trades back inside it.
2. Equilibrium line (0.5 of the gap)
Every FVG box gets an optional equilibrium line plotted at the midpoint between its top and bottom:
eq_level = (top + bottom) / 2.0
right_index = extend_boxes ? bar_index + extend_length_bars : bar_index
bx = box.new(bar_index - 2, top, right_index, bottom)
eq_ln = line.new(bar_index - 2, eq_level, right_index, eq_level)
line.set_style(eq_ln, line.style_dashed)
line.set_color(eq_ln, eq_color)
You can use this line as a neutral “fair value” reference inside the zone, or as a simple way to think in terms of premium/discount within each gap.
3. Mitigation rules and styling
Each FVG stays active until price trades back into the gap:
Bullish FVG is considered mitigated when the low touches or moves below the top of the gap.
Bearish FVG is considered mitigated when the high touches or moves above the bottom of the gap.
When that happens, the script:
Marks the internal FVGData entry as mitigated.
Softens the box fill and border colors.
Optionally updates the label text from "BULL EQ / BEAR EQ" to "BULL FILLED / BEAR FILLED".
Can hide mitigated zones almost completely if you only want to see unfilled imbalances.
This allows you to distinguish between current areas of interest and zones that have already been traded through.
4. Candle pattern overlays (engulfing and doji)
For additional confluence, the script can mark simple candle patterns on top of the FVG view:
Bullish engulfing — current candle body fully wraps the previous bearish body and is larger in size.
Bearish engulfing — current candle body fully wraps the previous bullish body and is larger in size.
Doji — candles where the real body is small relative to the full range (high–low).
The detection is based on basic body and range geometry:
curr_body = math.abs(close - open)
prev_body = math.abs(close - open )
curr_range = high - low
body_ratio = curr_range > 0 ? curr_body / curr_range : 1.0
bull_engulfing = close > open and close < open and open <= close and close >= open and curr_body > prev_body
bear_engulfing = close < open and close > open and open >= close and close <= open and curr_body > prev_body
is_doji = curr_range > 0 and body_ratio <= doji_body_ratio
On the chart, they appear as:
Small triangle markers below bullish engulfing candles.
Small triangle markers above bearish engulfing candles.
Small circles above doji candles.
All three overlays are optional and can be turned on or off and recolored in the CANDLE PATTERNS group of inputs.
5. Inputs overview
The script organizes settings into clear groups:
DISPLAY SETTINGS : Show bullish/bearish FVGs, show/hide mitigated zones, box extension length, box border width, and maximum number of boxes.
EQUILIBRIUM : Toggle equilibrium lines, color, and line width.
LABELS : Enable labels, choose whether to label unmitigated and/or mitigated zones, and select label size.
BULLISH COLORS / BEARISH COLORS : Separate fill and border colors for bullish and bearish gaps.
MITIGATED STYLE : Opacity used when a gap is marked as mitigated.
STATISTICS : Toggle the on-chart FVG statistics panel.
CANDLE PATTERNS : Show engulfing patterns, show dojis, colors, and the body-to-range threshold that defines a doji.
6. Statistics panel
An optional table in the corner of the chart summarizes the current state of all tracked gaps:
Total number of FVGs still being tracked.
Number of bullish vs bearish FVGs.
Number of unfilled vs mitigated FVGs.
Simple fill rate: percentage of tracked FVGs that have been marked as mitigated.
This can help you study how a particular market tends to treat gaps over time.
7. How you might use it (examples)
These are usage ideas only, not recommendations:
Study how often your symbol mitigates gaps and where inside the zone price tends to react.
Use higher-timeframe context and then refine entries near the equilibrium line on your trading timeframe.
Combine FVG zones with basic candle patterns (engulfing/doji) as an extra visual anchor, if that fits your process.
Hope you enjoy, give your feedback in the comments!
- officialjackofalltrades
Search in scripts for "fvg"
FVG & IFVG Box Detector
The "FVG & IFVG Box Detector" is a custom Pine Script v6 indicator for TradingView that identifies and highlights Fair Value Gaps (FVGs) and their subsequent mitigation as Imbalance Fair Value Gaps (IFVGs) on a price chart. Tailored for use on a 5-minute timeframe (though it must be manually set by the user due to script limitations), this indicator provides a visual representation of market imbalances using colored boxes, which automatically disappear when the gaps are filled by price action. The script is designed to be clean and minimalistic, omitting text labels or annotations as per your preference.Key FeaturesFVG Detection:A Bullish FVG is detected when the low of the current candle is higher than the high of the candle two bars ago, indicating a potential upward imbalance, visualized with a green-bordered box filled with a semi-transparent green background.
A Bearish FVG is detected when the high of the current candle is lower than the low of the candle two bars ago, indicating a potential downward imbalance, visualized with a red-bordered box filled with a semi-transparent red background.
A minimum gap size filter (default 0%) can be adjusted to exclude small gaps, ensuring only significant imbalances are highlighted.
IFVG Transition:When a Bearish FVG is filled (price closes below its lower boundary), the red box disappears, and a blue-bordered box with a semi-transparent blue background briefly appears to mark the Bullish IFVG, indicating the zone may now act as support. This box then vanishes.
When a Bullish FVG is filled (price closes above its upper boundary), the green box disappears, and an orange-bordered box with a semi-transparent orange background briefly appears to mark the Bearish IFVG, indicating the zone may now act as resistance. This box then vanishes.
The disappearance of boxes reflects the resolution of the imbalance, keeping the chart uncluttered.
Customization:Users can toggle the display of Bullish FVGs, Bearish FVGs, Bullish IFVGs, and Bearish IFVGs via input settings.
The extendBars parameter (default 50) controls how far to the right the boxes extend, allowing adjustment of their visibility duration.
Colors for Bullish FVG, Bearish FVG, Bullish IFVG, and Bearish IFVG can be customized using TradingView’s color picker, with defaults set to semi-transparent green, red, blue, and orange, respectively.
Performance:The script includes a cleanup mechanism to limit the number of active boxes to 50 per type, preventing performance issues by deleting the oldest boxes when the limit is exceeded.
It uses static variable assignments to ensure compatibility with Pine Script v6’s strict type requirements for drawing functions.
FunctionalityThe indicator scans each bar on the 5-minute chart to detect FVGs based on the defined conditions.
Upon detection, it creates a box extending from the starting bar (two bars ago) to the current bar plus the extendBars value, using the high and low prices to define the box’s vertical range.
When price action fills an FVG, the original box is deleted, and a brief IFVG box is created at the same price levels, which also disappears, signaling the imbalance has been neutralized.
No text or labels are displayed, ensuring a clean visual experience focused solely on the boxes.
Intended UseTraders: This tool is ideal for traders using FVG and IFVG concepts (common in Smart Money or ICT trading strategies) to identify potential support and resistance zones. The blue boxes (Bullish IFVGs) may indicate areas to buy or expect a bounce, while orange boxes (Bearish IFVGs) may indicate areas to sell or expect a pullback.
Chart Analysis: By observing when and where boxes appear and disappear, traders can track market structure shifts without cluttering the chart with annotations.
LimitationsThe script must be applied to a 5-minute chart manually, as the timeframe argument is not supported due to the use of drawing functions.
The brief appearance of IFVG boxes means historical levels must be tracked manually (e.g., via screenshots) or by adjusting the script to retain them if desired.
The minimum gap size filter might need tuning depending on the instrument (e.g., Gold) to capture relevant gaps.
Current Status (as of 08:53 AM EDT, October 23, 2025)The script is fully functional on your 5-minute chart, with the latest version (v5) resolving the timeframe error by removing the invalid argument. Boxes should now appear and disappear as intended, with green for Bullish FVGs, red for Bearish FVGs, blue for Bullish IFVGs, and orange for Bearish IFVGs.
FVGs, Env, BB & Knoxville: A Unified Analysis SuiteFVGs, Env, BB & Knoxville: A Unified Analysis Suite
I'm excited to share the Unified Market Analysis Suite, a powerful and comprehensive indicator designed to provide a multi-layered perspective on market dynamics.
Instead of cluttering your chart with separate tools, this script synergizes four key analytical concepts—Fair Value Gaps (FVGs), Volatility Bands (BB & Envelopes), and Momentum Divergence (Knoxville)—into one seamless package. The core philosophy is to help you identify, confirm, and act on high-probability setups by using each component to validate the others. This layered approach provides a more robust signal than any single indicator could alone.
How the Components Work Together: A Strategic Approach
This script is built for a step-by-step analysis, turning abstract data into actionable insights:
Step 1: Spot Potential Reversals with Knoxville Divergence. The process begins when a bullish or bearish Knoxville Divergence signal appears on your chart. This acts as an early warning, alerting you to a potential shift in momentum that is not yet reflected in the price trend.
Step 2: Identify Inefficiency with Fair Value Gaps (FVGs). Following a divergence signal, you then look for a Fair Value Gap to form in the direction of that divergence. For example, after a bullish divergence, a newly formed bullish FVG can serve as a high-probability zone for potential entries.
Step 3: Gauge Volatility with Bollinger Bands. The Bollinger Bands provide critical context. Is the FVG forming during a low-volatility squeeze, suggesting an explosive move might be imminent? Or is it occurring in a high-volatility environment where more caution is needed? An FVG that forms near or outside the bands can signal a particularly potent setup.
Step 4: Confirm with the Macro Trend using Envelopes. Finally, the long-term Envelope channel helps you see the bigger picture. This confirms whether your FVG/divergence setup is aligned with the dominant market trend (a continuation) or against it (a potential reversal), allowing you to manage your trade with greater confidence.
Key Features & Full Customization
Every component is highly customizable to fit your unique trading style.
1. Fair Value Gaps (FVGs) & Consequent Engulfment (CE)
Automatic Detection: Clearly identifies and plots bullish (UP) and bearish (DOWN) FVGs.
Dynamic Visuals: Boxes and CE lines extend until mitigated, with distinct colors for bullish and bearish gaps. You have the option to automatically hide filled boxes for a cleaner chart.
Mitigation Options: Choose whether FVG mitigation is calculated based on wicks or candle bodies.
Clear Labeling: A new feature adds an "FVG" text label inside each box, with adjustable size, color, and positioning.
Advanced Alerts: Receive alerts for FVG formation (confirmed and un-confirmed), price crossing an FVG's threshold (CE or full fill), and IOFED (price entry into an FVG).
2. Knoxville Divergence
Integrated Momentum Analysis: Uses a combination of RSI and Momentum to detect high-quality divergence signals.
Precision Control: Adjust RSI/Momentum lengths, the lookback period for finding divergences, and RSI overbought/oversold levels.
Intuitive Visuals & Alerts: Divergence lines are drawn directly on your chart with customizable colors, styles, and thickness. Alerts trigger the moment a new bearish or bullish divergence is confirmed.
3. Bollinger Bands (BB)
Classic Volatility Analysis: Monitor market volatility and identify potential price extremes.
Multiple MA Types: Choose from SMA, EMA, SMMA (RMA), WMA, or VWMA for the basis of the bands.
Full Customization: Adjust the length, source, and standard deviation multiplier.
4. Envelopes
Trend & Deviation Channel: Quickly assess price deviation from a central moving average.
Flexible Calculation: Can be calculated using either an SMA or EMA as the basis.
Clear Visuals: The channel is filled for easy and immediate interpretation of the broader trend.
Getting Started
This script is an overlay that plots directly on your price chart. After adding it, click the "Settings" cogwheel. You will find clearly organized sections for each of the four components, allowing you to enable, disable, and fine-tune every parameter to create the perfect analytical view for your strategy.
Acknowledgments and Development Process
This indicator is a comprehensive suite, and I want to be transparent about its development. The foundational logic for detecting three-bar Fair Value Gaps was inspired by the excellent open-source script by @twingall.
However, this module was not simply a copy; it was fundamentally re-architected and enhanced to serve as one component within this larger, original system. Here are the specific, significant improvements:
Architectural Refactoring: The original v5 code was entirely rewritten into a modular fvgManager function in Pine Script® v6, allowing it to integrate seamlessly with the other indicators.
New Feature (Dynamic Labels): I designed and implemented a system to add, manage, and customize text labels inside each FVG box—a feature not present in the original.
Original Components: The other three indicators in this suite—Envelopes, Bollinger Bands, and the Knoxville Divergence detector—are my own original code from the ground up.
Synergistic Integration: The primary development effort was focused on integrating these four distinct analytical tools. The FVG code was specifically modified to support advanced conditional visibility, ensuring it could be toggled on and off without conflicting with the other modules.
My goal was to build on a known concept and place it within a broader, synergistic framework. I truly believe the combination of these tools can enhance your analysis. If you find this script valuable, please consider giving it a boost to show your support.
I wish you all the best on your trading journey!
FVG - NibzDescription: Fair Value Gap (FVG) Indicator - Nibz
This Pine Script identifies and visualizes Fair Value Gaps (FVGs) on your TradingView chart. FVGs are price inefficiencies left behind when the market moves too quickly, skipping price levels that might not be tested. These gaps often act as magnets, attracting price for potential reversals or continuations.
The script works by detecting upward (bullish) and downward (bearish) price imbalances based on specific candlestick criteria and then marks these zones on your chart using customizable shaded boxes. This tool is essential for traders looking to identify key areas of market inefficiency that could signify support/resistance levels, potential reversal zones, or areas to monitor for market rebalancing.
How It Works
1. Bullish FVG Detection
The script identifies an upward imbalance when:
The low of the candlestick two bars back is less than or equal to the open of the previous bar.
The high of the current candlestick is greater than or equal to the close of the previous bar.
When this condition is met and the size of the imbalance is greater than zero, a green box is drawn from the low of the second candlestick back to the high of the current candlestick.
2. Bearish FVG Detection
The script identifies a downward imbalance when:
The high of the candlestick two bars back is greater than or equal to the open of the previous bar.
The low of the current candlestick is less than or equal to the close of the previous bar.
When this condition is met and the size of the imbalance is greater than zero, a red box is drawn from the low of the current candlestick to the high of the second candlestick back.
Customization Options
This script is highly customizable, allowing you to tailor the appearance of the FVG boxes to suit your trading style and chart aesthetics:
Bullish FVG:
Fill color and transparency.
Border color and transparency.
Bearish FVG:
Fill color and transparency.
Border color and transparency.
The settings are user-friendly, with intuitive sliders for transparency and color pickers for customization.
How to Use the Indicator
Adding the Script:
Add the indicator to your chart, and it will automatically mark bullish (green) and bearish (red) FVGs.
Interpreting FVGs:
Bullish FVGs (green zones): These often act as support or areas of potential price rebalancing on retracement.
Bearish FVGs (red zones): These often act as resistance or areas of interest for short entries.
Trade Ideas:
Use FVG zones to confirm other trade signals or strategies.
Watch for price interaction with these zones to time entries and exits.
Key Features
Automated detection of Fair Value Gaps.
Customizable visual representation to match your chart preferences.
Enhances trading precision by identifying price inefficiencies.
Suitable for scalping, day trading, or swing trading strategies.
This script provides a powerful tool to highlight important price levels and inefficiencies in the market, enabling traders to make informed decisions. Whether you're using it as a standalone indicator or combining it with other tools, the 'FVG - Nibz' indicator is a valuable addition to any trader's toolkit!
FVG Breakout/BreakdownThe FVG Breakout/Breakdown indicator is designed to identify potential breakout and breakdown opportunities in the market, based on the concept of Fair Value Gaps (FVGs). FVGs are areas where price moves too quickly, leaving behind gaps between candlesticks, often seen as areas of inefficiency or imbalance that the market tends to revisit.
Key Concepts:
Fair Value Gaps (FVG):
FVG occurs when a price gap is created between candlesticks, typically when the high of one candle is lower than the low of the previous candle (for a bearish FVG) or the low of one candle is higher than the high of the previous candle (for a bullish FVG).
These gaps represent an imbalance between buying and selling pressure, and the market often revisits them, making them valuable for identifying potential entry points.
Bullish FVG: This occurs when the low of the current candle is higher than the high of the previous candle.
Condition: low > high
Bearish FVG: This occurs when the high of the current candle is lower than the low of the previous candle.
Condition: high < low
Breakout/Breakdown Signals:
Breakout: A bullish breakout signal occurs when the price breaks above a defined resistance level after an FVG gap. This suggests that the market may continue moving higher.
Breakdown: A bearish breakdown signal occurs when the price breaks below a defined support level after an FVG gap. This suggests that the market may continue moving lower.
NWOG (New Week Opening Gap):
The NWOG can be used as an additional factor to confirm the FVG signal. The gap between Friday's close and Monday's open is a crucial level for identifying the start of a new move for the week.
NWOG helps to further refine the timing of breakout or breakdown signals, only triggering them when price moves relative to the Monday Open and shows a new direction.
FVG 15 min PilotOverview
This indicator implements a fully automated FVG (Fair Value Gap) rejection trading strategy with precise entry management, session limitation, and performance tracking. The indicator identifies fair value gaps, waits for the first tap into the 0.79 level, and automatically accepts entries with a fixed stop loss and an adjustable risk-reward ratio.
Overview
This indicator implements a fully automated FVG (Fair Value Gap) rejection trading strategy with precise entry management, session limitation, and performance tracking. The indicator detects fair value gaps, waits for the first tap into the 0.79 level, and automatically accepts entries with a fixed stop loss and an adjustable risk-reward ratio.
... Core Trading Logic
Entry Conditions
For LONG (Bullish FVG Rejection):
A bullish FVG must exist (upward price gap)
FVG must not be older than X candles (default: 20)
FVG must not be larger than X ticks (default: 50)
FVG must not have been tapped (not even before the trading session)
Price must touch the 0.79 level of the FVG
Entry occurs exactly at the 0.79 level (79% of the lower to the upper edge of the FVG)
SL is placed X ticks below the entry (default: 25)
TP is calculated based on a risk:reward ratio (default: 1:1)
For SHORT (Bearish FVG Rejection):
Identical logic to bearish FVGs
Entry at the 0.79 level (79% of the upper to the lower edge)
SL X ticks above the entry
TP is calculated based on a risk:reward ratio
FVG & IFVG MTF Detector [Alphaomega18]TITLE:
FVG & IFVG Multi-Timeframe Detector
SHORT DESCRIPTION:
Automatic Fair Value Gap (FVG) and Inverse Fair Value Gap (IFVG) detector with multi-timeframe analysis and automatic gap fill closure.
FULL DESCRIPTION:
📊 OVERVIEW
This indicator automatically detects Fair Value Gaps (FVG) and Inverse Fair Value Gaps (IFVG) on your current timeframe and up to 12 additional timeframes simultaneously. Perfect for confluence analysis and identifying institutional zones.
🎯 KEY FEATURES
✅ Multi-Timeframe Detection:
• 12 available timeframes: 1min, 2min, 5min, 10min, 15min, 30min, 1H, 2H, 4H, Daily, Weekly, Monthly
• Each timeframe with customizable color
• Timeframe labels positioned on the right of boxes
✅ Automatic Closure:
• FVGs automatically close when price fills the gap
• Option to disable for traditional fixed extension
• Smart midline management
✅ Complete Customization:
• Customizable colors for each timeframe
• Configurable label size, position, and style
• Gap size display options (separate for current TF and MTF)
• Transparent or colored labels for MTF
• Customizable borders and midlines
✅ Filters & Controls:
• Filter by minimum gap size
• Maximum boxes per timeframe
• Configurable box extension (5-100 bars)
• Border styles: Solid, Dashed, Dotted
✅ Integrated Dashboard:
• Active FVG/IFVG counter
• Statistics per timeframe
• Customizable position
📈 USAGE
1. **Timeframe Activation**:
- Go to Settings > Multi-Timeframe
- Check the timeframes you want to analyze
- Customize colors for each timeframe
2. **Display Configuration**:
- Settings > Display: control labels and their content
- "Transparent MTF Labels": displays only timeframe text without colored background
- "Show Gap Size": separate options for current TF and MTF
3. **Automatic Closure**:
- Settings > Filters > "Close FVG when Filled": enable to automatically close filled gaps
- Disable for traditional fixed extension
4. **Filtering**:
- "Min Gap Size": filter out insignificant small gaps
- "Max Boxes": control the number of FVGs displayed per timeframe
🔍 INTERPRETATION
• **Bullish FVG (🟢)**: Bullish gap - potential support zone
• **Bearish IFVG (🔴)**: Bearish gap - potential resistance zone
• **MTF Confluences**: Multiple FVGs from different timeframes at the same level = strong institutional zone
⚙️ TECHNICAL PARAMETERS
• Detection: low > high (bullish) | high < low (bearish)
• Max boxes per timeframe: 500
• Max lines: 500
• Automatic memory management (old FVG deletion)
🎨 ADVANCED CUSTOMIZATION
• Separate background and border colors
• 4 label sizes: Tiny, Small, Normal, Large
• 3 label positions for current TF: Left, Center, Right
• MTF labels always positioned right for clarity
• Optional midlines with customizable style and color
💡 USAGE TIPS
1. Start with 2-3 timeframes maximum to avoid visual overload
2. Use contrasting colors to easily differentiate timeframes
3. Daily/Weekly gaps are perfect for identifying major institutional zones
4. Combine with your price action strategy for precise entries
5. Automatic closure helps identify when a zone is invalidated
📊 IDEAL FOR
• ICT Traders (Inner Circle Trader)
• Scalping & Day Trading
• Swing Trading
• Institutional zone analysis
• Multi-timeframe confluence trading
🔔 ALERTS
Configurable alerts for:
• New Bullish FVG detected
• New Bearish IFVG detected
---
© 2024 Alphaomega18 - All rights reserved
License: Mozilla Public License 2.0
FVG & Market Structure//@version=5
indicator("FVG & Market Structure", overlay=true)
// Inputs
fvg_lookback = input.int(100, "FVG Lookback Period")
fvg_strength = input.int(1, "FVG Minimum Strength")
show_fvg = input.bool(true, "Show FVG")
show_liquidity = input.bool(true, "Show Liquidity Zones")
show_bos = input.bool(true, "Show BOS")
// Calculate swing highs and lows
swing_high = ta.pivothigh(high, 2, 2)
swing_low = ta.pivotlow(low, 2, 2)
// Detect Fair Value Gaps (FVG)
detect_fvg() =>
// Bullish FVG (current low > previous high + threshold)
bullish_fvg = low > high and show_fvg
// Bearish FVG (current high < previous low - threshold)
bearish_fvg = high < low and show_fvg
= detect_fvg()
// Plot FVG areas
bgcolor(bullish_fvg ? color.new(color.green, 95) : na, title="Bullish FVG")
bgcolor(bearish_fvg ? color.new(color.red, 95) : na, title="Bearish FVG")
// Breach of Structure (BOS) detection
detect_bos() =>
var bool bull_bos = false
var bool bear_bos = false
// Bullish BOS - price breaks above previous swing high
if high > ta.valuewhen(swing_high, high, 1) and not na(swing_high)
bull_bos := true
bear_bos := false
// Bearish BOS - price breaks below previous swing low
if low < ta.valuewhen(swing_low, low, 1) and not na(swing_low)
bear_bos := true
bull_bos := false
= detect_bos()
// Plot BOS signals
plotshape(bull_bos and show_bos, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Bullish BOS")
plotshape(bear_bos and show_bos, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Bearish BOS")
// Liquidity Zones (Recent Highs/Lows)
liquidity_range = input.int(20, "Liquidity Lookback")
buy_side_liquidity = ta.highest(high, liquidity_range)
sell_side_liquidity = ta.lowest(low, liquidity_range)
// Plot Liquidity Zones
plot(show_liquidity ? buy_side_liquidity : na, color=color.red, linewidth=1, title="Sell Side Liquidity")
plot(show_liquidity ? sell_side_liquidity : na, color=color.green, linewidth=1, title="Buy Side Liquidity")
// Order Block Detection (Simplified)
detect_order_blocks() =>
// Bullish Order Block - strong bullish candle followed by pullback
bullish_ob = close > open and (close - open) > (high - low) * 0.7 and show_fvg
// Bearish Order Block - strong bearish candle followed by pullback
bearish_ob = close < open and (open - close) > (high - low) * 0.7 and show_fvg
= detect_order_blocks()
// Plot Order Blocks
bgcolor(bullish_ob ? color.new(color.lime, 90) : na, title="Bullish Order Block")
bgcolor(bearish_ob ? color.new(color.maroon, 90) : na, title="Bearish Order Block")
// Alerts for key events
alertcondition(bull_bos, "Bullish BOS Detected", "Bullish Breach of Structure")
alertcondition(bear_bos, "Bearish BOS Detected", "Bearish Breach of Structure")
// Table for current market structure
var table info_table = table.new(position.top_right, 2, 4, bgcolor=color.white, border_width=1)
if barstate.islast
table.cell(info_table, 0, 0, "Market Structure", bgcolor=color.gray)
table.cell(info_table, 1, 0, "Status", bgcolor=color.gray)
table.cell(info_table, 0, 1, "Bullish BOS", bgcolor=bull_bos ? color.green : color.red)
table.cell(info_table, 1, 1, bull_bos ? "ACTIVE" : "INACTIVE")
table.cell(info_table, 0, 2, "Bearish BOS", bgcolor=bear_bos ? color.red : color.green)
table.cell(info_table, 1, 2, bear_bos ? "ACTIVE" : "INACTIVE")
table.cell(info_table, 0, 3, "FVG Count", bgcolor=color.blue)
table.cell(info_table, 1, 3, str.tostring(bar_index))
TXM-FVG-ALARM_4TFFVG Multi-Timeframe Indicator for TradingView
With this indicator, you get all the key Fair Value Gaps (FVGs) displayed at a glance for your current timeframe plus up to three additional timeframes of your choice.
Main Features
Current Timeframe Display
Always shows which chart timeframe you’re on, so you never lose track of your analysis level.
Multi-Timeframe FVG Detection
Current TF: Automatically identifies and marks all Fair Value Gaps on the active chart.
Up to 3 Extra TFs: Select up to three more periods (e.g. 1h, 4h, Daily) to view their FVGs simultaneously.
Flexible Visualization Options
Filled Box: Highlights FVG zones with solid rectangles.
Outline Only: Draws just the borders of each FVG for a cleaner look.
Combined Mode: Use both fill and outline to distinguish between different TFs or gap types.
Customizable Colors
Assign individual colors for each timeframe and for each visualization style (box and/or outline).
Save and load color presets to switch quickly between markets or strategies.
Alert Functionality
Set up alerts that trigger as soon as a new FVG appears in the current or any selected extra timeframe.
Choose between pop-ups, email alerts, or mobile push notifications.
Benefits at a Glance
Time Savings – Automatic detection and drawing of FVGs.
Clarity – See at once which timeframes have active gaps.
Personalization – Tailor colors and display modes to your workflow.
Responsiveness – Never miss a newly formed FVG thanks to real-time alerts.
Installation & Usage
Add the Indicator
In TradingView’s Public Library, search for “FVG Multi-TF Box & Frame.”
Configure Timeframes
In the indicator’s settings, pick your main TF plus up to three additional TFs.
Adjust Display
Toggle box fill, outline, or both, and set your colors for each TF.
Create Alerts
Go to the Alerts tab, select the indicator’s “New FVG Detected” condition, and choose your notification method.
Use the FVG Multi-Timeframe Indicator to enhance your chart analysis across all trading horizons—from quick scalping to longer-term swing strategies!
FVG (Nephew sam remake)Hello i am making my own FVG script inspired by Nephew Sam as his fvg code is not open source. My goal is to replicate his Script and then add in alerts and more functions. Thus, i spent few days trying to code. There is bugs such as lower time frame not showing higher time frame FVG.
This script automatically detects and visualizes Fair Value Gaps (FVGs) — imbalances between demand and supply — across multiple timeframes (15-minute, 1-hour, and 4-hour).
15m chart shows:
15m FVGs (green/red boxes)
1H FVGs (lime/maroon)
4H FVGs (faded green/red with borders) (Bugged For now i only see 1H appearing)
1H chart shows:
1H FVGs
4H FVGs
4H chart shows:
4H FVGs only
There is the function to auto close FVG when a future candle fully disrespected it.
You're welcome to:
🔧 Customize the appearance: adjust box colors, transparency, border style
🧪 Add alerts: e.g., when price enters or fills a gap
📅 Expand to Daily/Weekly: just copy the logic and plug in "D" or "W" as new layers
📈 Build confluence logic: combine this with order blocks, liquidity zones, or ICT concepts
🧠 Experiment with entry signals: e.g., candle confirmation on return to FVG
🚀 Improve performance: if you find a lighter way to track gaps, feel free to optimize!
FVG valid MTF (Fair Value Gaps across Multiple Timeframes)This indicator automatically detects and displays Fair Value Gaps (FVGs) across multiple timeframes (1D, 4H, 1H, 30M, 15M, 5M).
✨ Features:
Detects valid FVGs only when they appear after three consecutive candles in the same direction (bullish or bearish).
Each gap is color-coded by direction (bullish / bearish) and changes color once mitigated.
Automatic timeframe label inside each FVG box.
Fully customizable:
Minimum & maximum FVG size (in ticks),
Extension length of boxes into the future (bars),
Maximum number of FVGs displayed per timeframe.
After mitigation, FVGs are visually updated, making it easy to see whether the market has respected the imbalance zone.
📊 Practical Use:
Identify areas of imbalance where strong price reactions often occur.
Monitor FVGs across multiple timeframes – from daily charts down to intraday.
Useful for defining support/resistance zones, entry levels, or trade exits.
⚙️ Settings:
Adjustable FVG colors for bullish, bearish, and mitigated states.
Independent limit on how many FVGs are displayed for each timeframe.
Optimized for clarity and chart performance.
FVG + Bank Level Targeting w/ Alert TriggerDescription:
FVG + Bank Level Targeting w/ Alert Trigger is an intraday trading tool that combines Fair Value Gap (FVG) detection with dynamic institutional targeting using prior-day, weekly, and monthly high/low "Bank Levels." When a Fair Value Gap is detected, the script projects a logical target using the closest bank level in price's direction, and visually extends that level on your chart.
This tool is designed to help traders anticipate where price is most likely to move after an FVG appears — and alert them when price breaks through key target zones.
How It Works:
* Bank Level Calculation:
The indicator calculates Daily, Weekly, and Monthly high and low levels from the previous bar of each respective timeframe.
These are optionally plotted on the chart with a slight tick offset to avoid overlap with price.
* FVG Detection:
Bullish FVGs are defined by a gap between the low of the current candle and the high two candles prior, with a confirming middle candle.
Bearish FVGs follow the reverse pattern.
Once detected, the script finds the nearest unbroken institutional level (Bank Level) in the direction of the FVG and anchors a target line at that price level.
* Target Line Projection:
The script draws a persistent horizontal line (not just a plotted value) at the selected bank level.
These lines automatically extend a set number of bars into the future for clarity and trade planning.
* Breakout Detection:
When price crosses above a Bull Target or below a Bear Target, the script triggers a breakout condition.
These breakouts are useful for trade continuation or reversal setups.
* Alerts:
Built-in alert conditions notify you in real time when price crosses above or below a target.
These can be used to set TradingView alerts for your preferred Futures symbols or intraday pairs.
Parameters:
Tick Offset Multiplier: Adds distance between price and plotted levels.
Show Daily/Weekly/Monthly Levels: Toggle for each institutional level group.
FVG Extend Right (bars): Controls how far the target lines extend into the future.
Color Controls: Customize colors for FVG fill and target lines.
Use Case:
This indicator is designed for traders who want to:
Trade continuation or reversal moves around institutional price zones
Integrate Fair Value Gap concepts with more logical, historically anchored price targets
Trigger alerts when market structure evolves around key levels
It is especially useful for intraday Futures traders on the 15-minute chart or lower, but adapts well to any instrument with strong reactionary behavior at prior session highs/lows.
FVG - Fair Value Gap Detector with Large Movement FilterScript Description: Fair Value Gap (FVG) Detector with Large Movement Filter
This indicator is designed to identify Fair Value Gaps (FVG), which are price imbalances observed between three consecutive candles. Fair Value Gap detection is commonly used by traders to locate areas of imbalance where demand and supply temporarily lose equilibrium. This imbalance often draws price back to these zones, making them potential points of interest for buy or sell opportunities.
Key Features of the Indicator
FVG Detection Based on Three Consecutive Candles:
The script identifies a Fair Value Gap between three consecutive candles. This gap appears when the high of the first candle is below the low of the third candle (or vice versa). These gap zones are significant as they indicate an imbalance in price between buyers and sellers, with the expectation that price may revisit these areas in the future.
Large Movement Filter Using ATR:
To improve accuracy and avoid false signals in minor price fluctuations, this indicator includes a large movement filter based on the Average True Range (ATR). The ATR is calculated over a configurable period, and a multiplier is applied to set the minimum required range for a large movement. This helps ensure that only gaps in areas with significant price movement are identified.
Visual Differentiation with Customizable Colors:
The script allows users to configure FVG box colors for easy gap visualization. Identified zones on the chart are highlighted with a colored box, making it easy for the trader to identify imbalance points and observe potential mitigation.
FVG Mitigation and Capture:
The indicator continuously checks if the price is within the FVG zone, indicating that the gap has been mitigated or “captured” by the price. The mitigation or capture status is displayed visually on the chart, using a color scheme to indicate whether the gap has been retested by price after its creation.
How to Use the Indicator
Configuring Parameters:
ATR Multiplier: Defines how large a movement relative to ATR is required for the gap to be considered significant. Higher values require larger movements.
ATR Period: Sets the number of candles used in the ATR calculation, affecting the sensitivity to large movements.
Customizable Colors: Traders can adjust the FVG box colors and labels indicating mitigation and capture of the imbalance zones.
Visual Interpretation:
FVG Boxes: Colored boxes will appear on the chart to highlight gap zones. These boxes only display following the detection of a large movement, as defined by ATR.
Mitigation and Capture Labels: The indicator places a label below the bar when a gap is identified, highlighting zones where gaps may be mitigated or captured. The color scheme helps traders quickly interpret the status of a gap.
Underlying Concepts and Practical Application
The Fair Value Gap is widely used in liquidity analysis and price reversal zones. By identifying FVG zones based on large price movements, this script enables traders to monitor potential gap-fill areas. With the large movement filter, the indicator is ideal for strategies that prioritize liquidity and price zone mitigation, making it useful for both short-term (scalping) and long-term strategies.
This indicator provides a solid foundation for traders interested in observing price imbalances and future mitigations.
FVG Visual Super Clean (ticks)This is a robust and highly visual indicator designed for traders utilizing Smart Money Concepts (SMC) or Inner Circle Trader (ICT) methodologies.
Its core function is to automatically identify, visualize, and manage Fair Value Gaps (FVGs) or price inefficiencies, offering deep insight into institutional order flow.
Key Features & Capabilities
Advanced FVG Detection: Accurately identifies bullish and bearish Fair Value Gaps (FVGs) based on the 3-bar pattern.
Wick vs. Body Logic: Configurable option to use candle wicks (high/low) or bodies (open/close) for FVG calculation.
Displacement Confirmation: Includes an optional filter to require price displacement (a strong close) for higher conviction setups.
Mitigation Tracking & Management: The script actively tracks how much the price has filled or "mitigated" the FVG.
Threshold Auto-Removal: FVGs that reach a user-defined mitigation percentage (mitigation_pct) are automatically removed to keep the chart clean.
Mitigated Visibility: An optional setting allows mitigated FVGs to remain visible, repainting them with a distinct "Mitigated" color (blue by default) to show the exact point of rebalance.
Visual Efficiency:
Automatic Extension: Active, unmitigated FVGs are automatically extended forward in time until they are filled or pruned.
Equilibrium Line: Draws a dotted line at the 50% level (Equilibrium) of each FVG, a key reference point in SMC/ICT trading.
Tick-Based Filtering: Allows filtering gaps by a minimum size in ticks, reducing noise from insignificant micro-gaps.
Trend Context: Integrates a configurable Moving Average (EMA or SMA) for contextual trend analysis. The MA line changes color dynamically (green/red) to quickly signal momentum.
Optimized Performance: Implements a lookback window (lookback_days) and a cleanup routine to manage the number of drawing objects, ensuring smooth performance even on low timeframes.
Ideal For:
Traders focused on SMC/ICT Order Blocks, Imbalances, and Price Delivery.
Backtesting price action strategies around institutional liquidity.
Identifying high-probability entries (e.g., at the 50% line) and targets (e.g., unmitigated gaps).
ICT MTF FVG [MK]FVGs (Fair Value Gaps) are significant levels that may act as support or resistance to price. The script finds FVGs as per ICT trading system, then plots the full FVG to the right side of the chart. FVG boxes do not change size when they are semi-mitigated as its important to know where the original FVG midpoint lies. Plotting to the right side of price allows for a cleaner chart. The script is MTF and can display FVG boxes for the following timeframes. Chart, 5,10,15,30,1hr,4hr,8hr,12hr,D,W,M.
Below shows 1hr FVGs marked out. NOTE: this is not what the script does, this is for explanation only.
Below shows what the script will do. 1hr FVGs shown on 15min chart
FVG PRO AUTO**הסבר ותקציר לפרסום – אינדיקטור Fair Value Gap PRO (FVG PRO) למסחר חכם אוטומטי**
**עברית:**
אינדיקטור FVG PRO למסחר אוטומטי חכם לפי שיטת Fair Value Gap (SMC). האינדיקטור מזהה רמות מפתח לפי 15 דקות אוטומטית, מאתר תבניות FVG ו־Engulfing רק כשמתקיימים כל התנאים הקריטיים (שעות מסחר, מגמת EMA, ונפח מספק), ומציג סיגנלי כניסה, מטרות וסטופ בצורה ויזואלית ברורה עם התראות אוטומטיות. הכלי בנוי ב־Pine Script v6 המתקדם, מיועד לסוחרים שרוצים למקסם אמינות, להפחית איתותי שווא, ולהפוך מסחר על הגרף לאוטונומי ומדויק. אין צורך בהתערבות ידנית – כל ניתוח הסיגנלים, הסינון וההתראות מבוצעים אוטומטית ובאמינות. פתרון איכותי וחזק לסוחרי FVG ו־Smart Money.
**English:**
FVG PRO is an advanced automated trading indicator based on the Fair Value Gap (SMC) method. It automatically detects 15-minute key price levels and identifies FVG & Engulfing patterns—only when all strict trading conditions (session hours, EMA trend, and sufficient volume) are met. The indicator visually displays entry points, targets, and stop loss, with instant alerts. Built with Pine Script v6, it’s designed for traders seeking maximum signal reliability and minimum false alerts—making your TradingView chart clear, smart, and fully autonomous. No manual input needed: all signal detection, filtering, and alerts are automatic and robust. The ideal solution for professional FVG and Smart Money traders.
FVG Alerts (Vortus)What are Fair Value Gaps (FVGs)?
Fair Value Gaps (FVGs) represent price inefficiencies where buying and selling volumes are imbalanced, creating gaps between the wicks of consecutive candles. These gaps often act as magnets for price, as markets tend to "fill" these gaps before resuming their trend.
FVGs can signal potential entry or exit points, making them a valuable tool for traders looking to exploit these price inefficiencies.
How to Use the Script to Add Alerts:
1. Add the Script to Your Chart:
Load the script into TradingView by pasting it into the Pine Script Editor, then apply it to your chart.
2. Adjust Your Settings:
In the "FVG Settings" section, decide whether you want gaps to be removed after their midpoint or full fill. You can also choose to identify gaps only after a candle has closed, adding a level of confirmation to your strategy.
Customize the colors for Bullish and Bearish FVGs under "Visual Settings" to match your chart's theme.
3. Set Up Your Alerts:
After adding the script to your chart, go to the "Alerts" section in TradingView.
Select either "Bullish FVG Filled" or "Bearish FVG Filled" from the "Condition" dropdown menu.
Configure the alert parameters such as frequency, expiration, and notification method according to your trading strategy.
4. Stay on Top of the Market:
Once set up, the script will automatically notify you when a Fair Value Gap is filled, keeping you informed of potential reversal or continuation opportunities without needing to constantly monitor the charts.
Feedback is Welcome
FVG in MACROGuided by ICT tutoring, I created this versatile indicator to scan the FVG in MACRO time.
This indicator combines the MACRO time with the Fair value GAP (FVG) in an alternative way, showing a simple way of viewing the FVG within the MACRO time, so you can have a clearer view of which direction the MACRO is influencing
''MACRO is a delivery time frame of the interbank price in which it undergoes a series of controls and is likely to move towards liquidity.''
The user has the possibility to:
- Choose the relevant MACRO time
- Choose whether to view all FVGs in the MACROS
- Choose to view only the First FVG at each MACRO
The indicator should be used as shown by the ICT in its concepts, during the MACRO time the price can consolidate or can head towards liquidity.
The probability that the direction is correct increases with respect for the FVG, in this way it is possible to evaluate the entry zone in the FVG and the Take profit zone for Liquidity
As in the following example:
FVG TrackerThis indicator automatically detects and tracks Fair Value Gaps (FVGs) on your chart, helping you quickly spot imbalances in price action.
Key Features:
📍 Identifies FVGs larger than 3 contracts
📐 Draws each valid FVG as a rectangle directly on the chart
⏳ Removes FVGs once they are fully filled
🔟 Keeps track of only the 10 most recent FVGs for clarity
⚡ Lightweight and optimized for real-time charting
This tool is ideal for traders who use FVGs as part of Smart Money Concepts (SMC) or imbalance-based strategies. By visually highlighting only meaningful gaps and clearing them once filled, it ensures a clean and actionable charting experience.
FVG Zones (Remove Filled) + AlertA powerful TradingView indicator that automatically identifies Fair Value Gap (FVG) zones, removes them once price “fills” the gap, and sends you crystal-clear alerts specifying Bull or Bear zones—so you never miss a market imbalance.
🔍 Key Features
Automatic FVG Detection
Spots three-candle imbalance patterns (low > high for Bull, high < low for Bear) and draws colored boxes on your chart.
Auto-Remove Filled Zones
Once price enters a gap, the corresponding box is deleted—keeping your chart clutter-free.
Dedicated Alerts
Two separate alert conditions with constant messages:
“Price filled Bull FVG zone”
“Price filled Bear FVG zone”
On-Chart Labels
Enable debugging to display Bull FVG or Bear FVG tags above the triggering candle.
Performance-Tuned
Supports up to 500 active zones without slowing down your chart.
⚙️ Inputs & Customization
Show Alert Labels (Boolean) – Toggle on-chart text labels.
Max Boxes Count (Integer) – Control the maximum number of zones displayed.
Axelrod FVG v1FVG indicator --
Allows your Charts to stay CLEAN for your T.A. by plotting the FVGs on top of the Candles inside of its Borders
FVGs can also be turned off and you can Remove the Bar Color only
Each FVG has a tooltip that you can hover your mouse over to get the (Type of FVG, Size, Top, Middle, Bottom, Time)
FVGs Using Plots so that they go all the way back in history you can have more than 500 on the chart
FVG/IFVG Indicator (Blastoise's 85% Win-Rate Model)📈 Blastoise Trading Model — Liquidity + FVG + MSS
This indicator automates Blastoise's 85% Win-Rate Trading Strategy, built around high-probability intraday setups on NQ and ES using Draw on Liquidity (DOL), Market Structure Shifts (MSS), and Fair Value Gaps (FVG)
🔍 What It Does:
- Auto-Identifies All DOLs:
Marks Internal/External Highs & Lows, Asia High/Low, London High/Low, and News Data High/Low
- NY Session Logic (9:30 AM):
Activates only during the NY session to ensure volume and trend reliability
Waits for the first nearby DOL to get swept, then reads market reaction to generate a bias
- Automatic Bias Detection:
Example: If price takes out a DOL high and holds below = Bearish Bias
Example: If price takes out a DOL high and holds above = Bullish Bias into Next DOL
- Smart Entry Model with FVGs/IFVGs:
Once bias is set, the indicator scans all timeframes for valid FVG setups with the given bias
Once it finds the setup, it'll display the complete entry setup, including entry zone, stop loss, and price targets so you know EXACTLY when to get in
- Real-Time Setup Checklist:
Confirms DOL sweep, bias, volume, FVG/IFVG entry model, and MSS status.
Setup Rating Score (1–10) based on how many confirmations are present
- MSS Integration (Optional but Powerful):
Confirms Market Structure Shifts for reversals after DOL sweeps and updates the setup rating
FVG Zones – shrink on fill (bull/bear)Detects classic 3-candle FVGs (ICT definition).
Draws zones as boxes that extend to the right.
On each bar close:
Checks overlap with the current candle.
Shrinks the zone when price wicks into it (bullish: top moves down; bearish: bottom moves up).
Deletes the zone once it’s completely filled/closed.
Inputs: bullish/bearish zone color, border color, and max number of visible FVGs.
Possible extensions:
Multi-timeframe FVGs (e.g. H1 FVGs shown on M5).
Separate limits for bullish and bearish zones.
Alerts for new FVG, partial fill, or closed FVG.
Option “Body only” (ignore wicks when detecting overlap).
Minimum FVG size filter (ticks/ATR).






















