OPEN-SOURCE SCRIPT
Inversion FVG Tracker [forexobroker]

Inversion FVG Tracker [forexobroker] detects 3-candle Fair Value Gaps, watches for them to be fully mitigated, and then trades the inversion: a filled bullish FVG flips into resistance and a filled bearish FVG flips into support. Signals fire on the retest of an inverted gap. The unique angle is the full lifecycle state machine (fresh, inverted, retested) combined with an ATR-scaled minimum gap so micro-gaps are ignored.
🔶 ALGORITHM
1. ATR (default 14) is computed for gap-size scaling.
2. A bullish FVG forms when the current low is above the high two bars back and the gap spans at least the minimum (default 0.10 x ATR). A bearish FVG mirrors this with the current high below the low two bars back.
3. The most recent bull and bear FVG are tracked with a state value: fresh, mitigated/inverted, or retested.
4. Unmitigated FVGs older than the max age (default 60 bars) are discarded.
5. Mitigation uses close by default: a bull FVG closing fully below its bottom inverts to resistance; a bear FVG closing fully above its top inverts to support.
6. A retest buffer (default 0.10 x ATR) defines the inverted-zone test; an inverted bull FVG retested from below is bearish, an inverted bear FVG retested is bullish.
7. An inversion arms a persistent bias (bear FVG to support is bullish, bull FVG to resistance is bearish) that holds until the opposite inversion; entries then time off a reclaim EMA (default 9).
🔶 SIGNAL LOGIC
- Buy: in retest-only mode, an inverted bear-FVG retest (support); otherwise active inversion bias is bullish AND close crosses over the reclaim EMA, AND session filter passes AND position is not already long AND cooldown bars elapsed AND barstate.isconfirmed.
- Sell: in retest-only mode, an inverted bull-FVG retest (resistance); otherwise active inversion bias is bearish AND close crosses under the reclaim EMA, AND session filter passes AND position is not already short AND cooldown bars elapsed AND barstate.isconfirmed.
Only fires once an FVG has actually inverted to arm the bias.
🔶 INPUTS
- FVG group: minimum gap size as a multiple of ATR; default 0.10.
- ATR Length: volatility reference for gap and buffer scaling; default 14.
- Mitigate on Close: when on, an FVG inverts only when close passes fully through it; default on.
- Retest Buffer x ATR: tolerance around the inverted zone; default 0.10.
- FVG Max Age (bars): unmitigated gaps older than this are dropped; default 60.
- Signal Logic group: entry reclaim EMA default 9, retest-only mode default off, cooldown bars default 5.
- Filters group: optional session restriction; window default 0000-2400.
- Visual group: FVG zone boxes, dashboard, 3-layer glow, buy/sell colors, dashboard background.
🔶 ALERTS
IFT Buy, IFT Sell, IFT Any Signal, IFT Bull FVG, IFT Bear FVG, IFT Bull Inverted, IFT Bear Inverted, IFT Inv Bull Test, IFT Inv Bear Test, IFT Any FVG, IFT Inversion Live, IFT Webhook JSON.
🔶 LIMITATIONS
- A 3-candle FVG needs the two trailing bars, so the earliest chart bars produce no gaps.
- Only the most recent bull and bear FVG are tracked; older overlapping gaps are not retained.
- Defaults are tuned for liquid instruments; wide-spread or gappy symbols may need a larger minimum gap.
- Unmitigated gaps expire by age, so a very slow return to a valid gap can miss the inversion window.
- The non-retest-only path uses a fast EMA cross and can fire extra entries inside one inversion bias.
🔶 ALGORITHM
1. ATR (default 14) is computed for gap-size scaling.
2. A bullish FVG forms when the current low is above the high two bars back and the gap spans at least the minimum (default 0.10 x ATR). A bearish FVG mirrors this with the current high below the low two bars back.
3. The most recent bull and bear FVG are tracked with a state value: fresh, mitigated/inverted, or retested.
4. Unmitigated FVGs older than the max age (default 60 bars) are discarded.
5. Mitigation uses close by default: a bull FVG closing fully below its bottom inverts to resistance; a bear FVG closing fully above its top inverts to support.
6. A retest buffer (default 0.10 x ATR) defines the inverted-zone test; an inverted bull FVG retested from below is bearish, an inverted bear FVG retested is bullish.
7. An inversion arms a persistent bias (bear FVG to support is bullish, bull FVG to resistance is bearish) that holds until the opposite inversion; entries then time off a reclaim EMA (default 9).
🔶 SIGNAL LOGIC
- Buy: in retest-only mode, an inverted bear-FVG retest (support); otherwise active inversion bias is bullish AND close crosses over the reclaim EMA, AND session filter passes AND position is not already long AND cooldown bars elapsed AND barstate.isconfirmed.
- Sell: in retest-only mode, an inverted bull-FVG retest (resistance); otherwise active inversion bias is bearish AND close crosses under the reclaim EMA, AND session filter passes AND position is not already short AND cooldown bars elapsed AND barstate.isconfirmed.
Only fires once an FVG has actually inverted to arm the bias.
🔶 INPUTS
- FVG group: minimum gap size as a multiple of ATR; default 0.10.
- ATR Length: volatility reference for gap and buffer scaling; default 14.
- Mitigate on Close: when on, an FVG inverts only when close passes fully through it; default on.
- Retest Buffer x ATR: tolerance around the inverted zone; default 0.10.
- FVG Max Age (bars): unmitigated gaps older than this are dropped; default 60.
- Signal Logic group: entry reclaim EMA default 9, retest-only mode default off, cooldown bars default 5.
- Filters group: optional session restriction; window default 0000-2400.
- Visual group: FVG zone boxes, dashboard, 3-layer glow, buy/sell colors, dashboard background.
🔶 ALERTS
IFT Buy, IFT Sell, IFT Any Signal, IFT Bull FVG, IFT Bear FVG, IFT Bull Inverted, IFT Bear Inverted, IFT Inv Bull Test, IFT Inv Bear Test, IFT Any FVG, IFT Inversion Live, IFT Webhook JSON.
🔶 LIMITATIONS
- A 3-candle FVG needs the two trailing bars, so the earliest chart bars produce no gaps.
- Only the most recent bull and bear FVG are tracked; older overlapping gaps are not retained.
- Defaults are tuned for liquid instruments; wide-spread or gappy symbols may need a larger minimum gap.
- Unmitigated gaps expire by age, so a very slow return to a valid gap can miss the inversion window.
- The non-retest-only path uses a fast EMA cross and can fire extra entries inside one inversion bias.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.