Three ideas stack inside the fvg ifvg + sfp indicator, and only the top one produces a trade mark. A gap gets noted. A gap price closes back through becomes an inversion, which flips its meaning. Where that inversion lands on a bar that also swept a swing and failed, an arrow prints.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 4: SFP+iFVG Buy, SFP+iFVG Sell, iFVG Mark, FVG Mark |
| Alerts | popup |
| Inputs | 5 |
What you see once it loads
Four arrow plots, all on price.
`SFP+iFVG Buy` prints lime at width 3.
`SFP+iFVG Sell` prints red at the same width.
`iFVG Mark` uses arrow 159 in dodger blue.
`FVG Mark` uses arrow 158 in goldenrod.
Marks stand `InpArrowOffsetPts` `14` points off.
- SFP+iFVG Buy: arrow, lime, width 3, arrow code 233
- SFP+iFVG Sell: arrow, red, width 3, arrow code 234
- iFVG Mark: arrow, dodger blue, width 2, arrow code 159
- FVG Mark: arrow, goldenrod, width 1, arrow code 158

The inner steps
Three bars, one hole
A gap opens between them. Take the low one bar back sitting above the high one bar forward, or the mirror of that. `InpMinFvgPts` `3.0` drops anything thinner.
Flipping it
A recorded gap stays under watch. Price trading into it and closing through the far side inverts it, which earns the blue mark and flips what the level means.
The swing failure
`InpSwing` `3` bars either side define a swing. A bar that pushes past one and closes back inside has failed, and only that bar plus an inversion earns the trade arrow.
How to watch it
Gold marks are gaps, and they are common.
Blue marks are gaps that have inverted.
Lime and red need an inversion and a sweep together.
So the trade marks are far rarer than the others.
`InpLookbackBars` `60` limits how long a gap is remembered.
Nothing appears in a pane below price.
Alert channels in this build: popup, one message per closed bar.
Only the combined arrow reports, not the gap or inversion marks, and `InpEnableAlerts` is the single switch over it. Messages go to the terminal on a closed bar. No phone, mail or audio route exists in this build.
Every FVG IFVG + SFP Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpSwing |
SFP swing lookback (bars left/right). Bars either side defining a swing, `3`. | 3 |
InpLookbackBars |
Bars to remember FVGs/swings. How long a gap stays remembered, `60`. | 60 |
InpMinFvgPts |
Minimum FVG size in points. Smallest gap worth recording, `3.0`. | 3.0 |
Display settings
| Setting | What it does | Default |
|---|---|---|
InpArrowOffsetPts |
Arrow offset from candle in points. How far a mark stands off, `14`. | 14 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
InpEnableAlerts |
Whether a trade mark reports, `true`. | on |

Fitting it to a chart
Sixty bars of memory keeps the gaps recent rather than historical. EURUSD H1 is the reference chart, covering two and a half days. Drop to M5 and gaps expire within hours. Move to H4 and the window reaches back a fortnight.
When it is unreliable
A three-point floor accepts very small gaps.
Four mark types on one chart is a busy read.
Both halves confirm late, so the arrow does too.
A gap is a chart pattern, not evidence of orders.
Copy the compiled FVG IFVG + SFP Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Download the FVG IFVG + SFP Indicator for MT4 and MT5
The zip holds the compiled FVG IFVG + SFP Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
What does the iFVG Mark actually flag?
A gap price has closed back through. The level then changes character: what acted as one side of the market becomes the other, which is why it earns its own blue mark instead of simply disappearing.
Why does SFP+iFVG Buy need two conditions?
Because either alone is common. Requiring an inversion and a swept swing on the same bar is what makes the lime and red arrows rare, and rarity is the entire point of stacking two tests rather than trading each one.
What does InpSwing 3 treat as a failed sweep?
A bar that pushes beyond a swing set by three bars either side and then closes back inside it. A push without that close back is simply a break, and it prints nothing at all.
Is InpMinFvgPts 3.0 too small a floor?
On most five-digit majors it is very permissive, since three points is under half a pip. Raising it is the first adjustment worth making, because it cuts the gold marks down to gaps that actually matter.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the FVG IFVG + SFP Indicator as one input. Always backtest before trading live.
Category: this is part of our Smart Money collection. Then, plainly, browse more Smart Money for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see Speculative demand for money on Wikipedia.
- For broader market context, see Technical Analysis 101 at StockCharts ChartSchool.
