




Built an ICT iFVG setup detector with multi-TF confluence grading
Hey r/TradingView. Sharing something I've been building for the last few months.
What it is
IFVG Sniper detects a specific ICT pattern: liquidity sweep followed by Fair Value Gap inversion. Standard concept, but the implementation tries to handle the edge cases properly:
- Tracks sweep targets across 7 TFs (5m, 15m, 30m, 1H, 4H, 1D, 1W) plus PDH/PDL/PWH/PWL and session H/Ls
- Detects HTF "pivots" at bar close with no right-side lag
- TF-aware FVG mitigation (a 1H FVG only dies on a 1H close through it, not a 1m wick)
- Confluence grader (A+ to D) based on HTF FVG alignment, SMT divergence vs ES, killzone timing, iFVG size vs ATR, and displacement
- Anti-repaint via
[1]shift on allrequest.security()calls
Built for
NQ/MNQ on 1m–5m. Will work on ES/MES and other index futures. Not designed for crypto or FX (sweep dynamics differ).
Pine details for the dev crowd
This was a fun exercise in Pine v6 multi-timeframe state management. The hardest parts:
- Unified liquidity pool across 7 TFs with stale-price dedup (a swept level shouldn't re-add itself when a new HTF bar lands on the same price)
- Multi-candidate FVG tracking where the entry fires on whichever FVG price hits first chronologically (not insertion order)
- Pool + fallback HTF FVG detection so chart-load-order doesn't cause missed grades
About 1,400 lines of v6. No external libraries. Stays well under Pine's compute limits.
Honest about what it isn't
- It's a setup detector, not a strategy. No entries, stops, or position sizing baked in.
- The grade is a confluence score, not a profit prediction. A+ setups still lose.
- Won't save you during news.
Access
Invite-only on TradingView.
https://www.tradingview.com/script/ksu0JWDy-IFVG-Sniper-InvestorPrime/
https://x.com/InvestorPrime_