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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
🔵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.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
🔵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.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.