All indicators

Fair Value Gaps

May 18, 2025

Static chart image
Price Action BasedSupport and ResistanceFVG

The Fair Value Gaps indicator automatically detects and visualizes price inefficiencies to help traders identify high-probability points of interest for entries, re-entries, or reversals.

Usage

The tool identifies Fair Value Gaps (FVGs), which occur when price moves aggressively, leaving a gap between the wicks of three consecutive candles. These zones often act as magnets for price to "fill" before continuing in the original direction.

  • Dynamic vs. Static Mode: By default, the script tracks price action and dynamically shrinks the FVG box as price trades into it. This provides a real-time view of the remaining imbalance. You can toggle "Dynamic (shrinking) gaps" off to keep the original gap size visible until it is fully mitigated.
  • Automatic Cleanup: To maintain a clean workspace, the script automatically removes gaps once they have been fully filled by price action.
  • Gap Filtering: Users can set a minimum gap size percentage to filter out minor imbalances, ensuring only significant market moves are highlighted.
  • Alerts: The script includes alerts for both the creation of new gaps and the moment price enters an existing gap.

Details

Fair Value Gaps represent market imbalances where buy or sell orders were not efficiently matched. This script implements logic to detect these imbalances across any asset class. It specifically tracks whether price has "triggered" a gap (entered it) and calculates the mitigation of the zone. The script is optimized to handle up to 500 boxes and lines, though users can limit the number of active unfilled gaps displayed to manage visual clutter.

Settings

Boxes

  • Extend boxes: Determines how many bars into the future the FVG boxes are projected.
  • Min Gap Size (%): Filters gaps based on a minimum percentage threshold relative to the price.
  • Dynamic (shrinking) gaps: When enabled, boxes adjust their size based on partial fills. When disabled, they remain static.
  • Max Unfilled Gaps to Display: Limits the number of active imbalances shown on the chart simultaneously.

Colors

  • Bullish Gap Color: Sets the background color for bullish (undervalued) gaps.
  • Bearish Gap Color: Sets the background color for bearish (overvalued) gaps.

Midline

  • Show Midline: Toggles a line representing the 50% level (Consequent Encroachment) of the gap.
  • Midline Style: Choose between Solid, Dashed, or Dotted line styles.

Label

  • Show FVG Label: Displays a text label on the FVG boxes for easier identification.
  • Label Size: Adjusts the text size of the labels (Tiny, Small, Normal, Large).

FAQ

How do I access Fair Value Gaps?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What is the midline shown in the gaps?

The midline represents the 50% point of the imbalance, often referred to in trading models as Consequent Encroachment, which acts as a secondary level of support or resistance.

Can I use this on any timeframe?

Yes, the indicator is designed to be universal and can be used on any timeframe from 1-minute scalping to weekly trend analysis.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.