STATUS: IN DEVELOPMENTPINE + MQL5 SOURCE: PROVIDED, NOT YET TESTED ON A PLATFORMRELEASED: NONE
Fair value gap indicator

FVG indicator: marks the gap, predicts nothing

It draws a box wherever three candles in a row leave a gap between the first candle's range and the third candle's range. It marks a pattern that has already formed. It does not tell you what price will do next.

Not released The detector below works now. The TradingView and MT5 files are source provided, not yet tested on a platform.

Minimum gap size The slider is a demonstration on a real chart. The files use a minimum in price units.

All 9 gaps shown. Move the slider to hide the small ones.

GBPUSD15 minute6 bullish 3 bearish · 9 gaps by the rule
1.336001.338001.340001.3420006:0008:0010:0012:0014:0016:00123456789
  1. 1Bearish1.33940 to 1.34041formed 10:15 UTCTraded through at 17:00 UTC
  2. 2Bearish1.33786 to 1.33818formed 11:15 UTCTraded through at 16:00 UTC
  3. 3Bearish1.33703 to 1.33767formed 11:30 UTCTraded through at 12:00 UTC
  4. 4Bullish1.33646 to 1.33653formed 15:30 UTCTraded through at 15:30 UTC
  5. 5Bullish1.33742 to 1.33800formed 16:15 UTCNot revisited by 18:00 UTC
  6. 6Bullish1.33808 to 1.33883formed 16:30 UTCNot revisited by 18:00 UTC
  7. 7Bullish1.33939 to 1.33947formed 17:00 UTCNot revisited by 18:00 UTC
  8. 8Bullish1.33970 to 1.33992formed 17:15 UTCNot revisited by 18:00 UTC
  9. 9Bullish1.34017 to 1.34018formed 17:30 UTCTraded through at 17:30 UTC
GBPUSD, 2026-10-22, 06:00 to 18:00 UTC. Real candles: Dukascopy 15-minute candles, read 2026-10-31. Fair value gap by the three-candle wick rule. Each box runs from its gap until a later candle trades through its far edge, or to the end of the chart. The minimum size is set by the reader.

Real GBPUSD 15-minute candles from 2026-10-22. The slider sets the minimum size as a share of this window's average candle range (high minus low). With JavaScript off, every gap is shown.

Detector

Find the gaps in your own candles

Paste one candle a line, as open,high,low,close (or time,open,high,low,close), or pick a real sample window. It applies the rule below exactly: bullish if the low of candle 3 is above the high of candle 1, bearish if the high of candle 3 is below the low of candle 1, strict, wicks only. Everything runs in your browser; nothing is sent.

The detector needs JavaScript, which is off or has not loaded. The rule and a real chart with its gaps are on this page without it; read the next section.

Status: "filled" means a later candle traded through the far edge of the gap; "touched" means one traded back into it but not through; "not revisited" means neither happened in the candles you gave. None of these is a forecast. The same function is the one behind the chart on this page, and the same rule is in the Pine Script and MQL5 files.

The rule

Two comparisons on closed candles

There is no judgement in it. A gap exists or it does not. For what the pattern means to traders and how educators define it, see this guide to the pattern.

Bullish gap

candle 3 low > candle 1 high

The third candle's low stays above the first candle's high. The gap is the space between them.

Bearish gap

candle 3 high < candle 1 low

The third candle's high stays below the first candle's low. The gap is the space between them.

When it is drawn

only after candle 3 closes

Educators differ on whether a tiny gap counts and what "filled" means. That is why the minimum size is a setting, and the fill rule is stated.

How the box is drawn

How a bullish fair value gap box is drawn, in four stepsStep 1: candle 3 is still open, nothing drawn. Step 2: candle 3 closes with its low above candle 1's high and the box starts. Step 3: the box extends to the right while price stays above it. Step 4: a candle trades through the gap and the box stops.1 Candle 3 is openNothing is drawn yet.The candle may still change.2 Candle 3 closesLow is above candle 1 high.The box starts.3 The box extendsPrice stays above the gap.The box gets longer.4 Price trades throughThe box ends here.The gap is filled.
Diagram, not a market chart. A bullish gap drawn step by step. A bearish gap is the same picture upside down.
Repainting

Marked after the close, by the code

An indicator that draws a gap while candle 3 is still open can erase it a minute later. The source files wait for the close. This is what the code says; it has not been run on a platform yet. The details are on the Pine Script and MQL5 pages.

Marking on an open candle compared with marking after the closeTwo timelines. In the top one a box appears while candle 3 is open and disappears when the candle closes with its low back inside candle 1's range. In the bottom one nothing is drawn until candle 3 closes, and the box then stays.Candle 3 is openCandle 3 closesMarks the open candle(repaints)gap shown too earlyGone at the close:the low fell back into candle 1's range.Marks after the close(what the source files do)nothing drawn yetDrawn once, then only extended
Diagram, not a market chart. Time runs left to right.
Real data

How many gaps survive a minimum size

Without a minimum, a normal session fills the chart with boxes. Here is how the count falls as the minimum rises.

Median gaps per session window, by minimum size

No minimum9
10% of average range7
25% of average range5
50% of average range2

Sample: 1,500 session windows of 8 instruments (AUDUSD, EURUSD, GBPUSD, NZDUSD, USDCAD, USDCHF, USDJPY, XAUUSD), 2025-12-29 to 2026-10-30. Each window is 48 fifteen-minute candles, 06:00 to 18:00 UTC. The rule is the three-candle wick rule above; a gap is kept if its height is at least the stated share of that window's average candle range (high minus low). Counts only; this says nothing about whether the gaps are useful.

Settings

Six inputs, one more in MQL5

Each hidden choice in the rule is an input in the source files. The full explanation is on the settings page.

Inputs of fvg.pine and fvg.mq5 Source provided, not yet tested
InputWhat it doesDefault
minSizeIgnores gaps with a height below this, in price units.0.0
lookbackOnly gaps whose candle 3 is within this many bars of the last bar are drawn.300
showFilledKeep a filled gap on the chart, stopped at the bar that filled it.true
extendOpenExtend a gap that is not filled to the last closed bar.true
bullColor, bearColorBox colours.blue, red
alertOnNewMQL5 only: alert when the last closed bar completes a gap.false
A second window

The same rule, with a 25% minimum

On AUDUSD, 2026-10-29, the plain rule finds 10 gaps. With a minimum of 25% of the window's average candle range, 5 are left.

AUDUSD15 minute4 bullish 1 bearish · 5 gaps by the rule
0.702000.703000.704000.7050006:0008:0010:0012:0014:0016:0012345
  1. 1Bullish0.70333 to 0.70356formed 11:15 UTCTraded through at 11:45 UTC
  2. 2Bullish0.70364 to 0.70377formed 11:30 UTCTraded through at 11:30 UTC
  3. 3Bearish0.70311 to 0.70339formed 12:15 UTCTraded through at 12:30 UTC
  4. 4Bullish0.70216 to 0.70239formed 14:45 UTCNot revisited by 18:00 UTC
  5. 5Bullish0.70309 to 0.70329formed 15:45 UTCRe-entered at 15:45 UTC, not traded through
AUDUSD, 2026-10-29, 06:00 to 18:00 UTC. Real candles: Dukascopy 15-minute candles, read 2026-10-31. Fair value gap by the three-candle wick rule with a minimum size of 25% of the window's average candle range. Each box runs until a later candle trades through its far edge, or to the end of the chart.
What is coming

Three versions

Only the browser detector can be used today. The two indicator files are source to read, not yet tested on a platform. There are no release dates.

TradingView

Pine Script v6. Read the source.

Source provided, not tested

MetaTrader 5

MQL5. Read the source. MT4 has no version yet.

Source provided, not tested

Browser detector

Runs in the page. Paste candles, get the gaps the rule finds.

Working

Alerts are early access and not available: see alerts. Free and paid versions are planned: see free.

Scorecard

How to judge any fair value gap indicator

Five checks that apply to every FVG indicator, whoever made it.

  1. Does it repaint?

    Watch it on a live chart. A gap that appears before candle 3 closes, or vanishes later, is a problem. The source files mark only closed candles.

  2. Can you read its rule?

    You should find, in words or open code, exactly when it draws a gap. If the rule is hidden, you cannot know what the boxes mean.

  3. Can you set a minimum size?

    Without one, small gaps that mean little crowd the chart.

  4. Does it say when a gap is filled?

    Check whether the box stops, changes or disappears, and what counts as filled.

  5. Does it work on your timeframe?

    Test it on the timeframe and market you trade, with enough history loaded.

Limits

What an indicator cannot do

It does not predict

A marked gap is a record of three candles, not a forecast.

It does not size risk

How much to trade, and where a trade is wrong, are your decisions.

A gap is not a signal

Many gaps are filled, many are ignored, and the box cannot say which.

If you want a tool for another concept, a separate order block indicator site is planned.

FAQ

Questions

More on the FAQ page.

Is the fair value gap indicator free?

The browser detector on this page is free to use. The Pine Script and MQL5 source files can be read on this site. A free limited version and a paid one-time licence are planned; nothing is on sale and no price is set.

Does the indicator repaint?

By its code, no gap is drawn on the forming bar. The Pine source draws only on the closing tick of candle 3 and the MQL5 source reads closed bars only. A drawn box is then extended or stopped, and with showFilled off the Pine source deletes a filled box. This describes the code; it has not been run on a platform yet.

Which platforms does it run on?

The browser detector runs here. The TradingView (Pine Script v6) and MetaTrader 5 (MQL5) sources are provided but not yet tested on a platform, so they are not released. An MT4 version does not exist yet.

What settings does it have?

minSize, lookback, showFilled, extendOpen, bullColor and bearColor in both sources, and alertOnNew in the MQL5 source only. Each is explained on the settings page.

Will it work on any pair and timeframe?

The rule only needs the highs and lows of three consecutive candles, so it can be applied to any instrument and timeframe. How useful the gaps are on a given market is a separate question that this page does not answer.

How accurate is it?

There is no accuracy figure, because the indicator does not make predictions to score. It marks a pattern that has already formed. To measure how a marked gap behaves afterwards, you would need a written definition of the outcome, a long sample across markets and years, and results that include the gaps that did nothing. None of that has been done.

Waitlist

One email when a tested version is released. Nothing else.

Sign-up is not switched on yet; the form says so if you try it.