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.
All 9 gaps shown. Move the slider to hide the small ones.
- 1Bearish1.33940 to 1.34041formed 10:15 UTCTraded through at 17:00 UTC
- 2Bearish1.33786 to 1.33818formed 11:15 UTCTraded through at 16:00 UTC
- 3Bearish1.33703 to 1.33767formed 11:30 UTCTraded through at 12:00 UTC
- 4Bullish1.33646 to 1.33653formed 15:30 UTCTraded through at 15:30 UTC
- 5Bullish1.33742 to 1.33800formed 16:15 UTCNot revisited by 18:00 UTC
- 6Bullish1.33808 to 1.33883formed 16:30 UTCNot revisited by 18:00 UTC
- 7Bullish1.33939 to 1.33947formed 17:00 UTCNot revisited by 18:00 UTC
- 8Bullish1.33970 to 1.33992formed 17:15 UTCNot revisited by 18:00 UTC
- 9Bullish1.34017 to 1.34018formed 17:30 UTCTraded through at 17:30 UTC
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.
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.
| Kind | Candles | Bottom | Top | Height | After candle 3 |
|---|
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.
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
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.
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.
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.
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.
| Input | What it does | Default |
|---|---|---|
| minSize | Ignores gaps with a height below this, in price units. | 0.0 |
| lookback | Only gaps whose candle 3 is within this many bars of the last bar are drawn. | 300 |
| showFilled | Keep a filled gap on the chart, stopped at the bar that filled it. | true |
| extendOpen | Extend a gap that is not filled to the last closed bar. | true |
| bullColor, bearColor | Box colours. | blue, red |
| alertOnNew | MQL5 only: alert when the last closed bar completes a gap. | false |
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.
- 1Bullish0.70333 to 0.70356formed 11:15 UTCTraded through at 11:45 UTC
- 2Bullish0.70364 to 0.70377formed 11:30 UTCTraded through at 11:30 UTC
- 3Bearish0.70311 to 0.70339formed 12:15 UTCTraded through at 12:30 UTC
- 4Bullish0.70216 to 0.70239formed 14:45 UTCNot revisited by 18:00 UTC
- 5Bullish0.70309 to 0.70329formed 15:45 UTCRe-entered at 15:45 UTC, not traded through
How to judge any fair value gap indicator
Five checks that apply to every FVG indicator, whoever made it.
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.
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.
Can you set a minimum size?
Without one, small gaps that mean little crowd the chart.
Does it say when a gap is filled?
Check whether the box stops, changes or disappears, and what counts as filled.
Does it work on your timeframe?
Test it on the timeframe and market you trade, with enough history loaded.
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.
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.
Sign-up is not switched on yet; the form says so if you try it.