OPEN-SOURCE SCRIPT

FVG (Nephew sam remake)

968
Hello i am making my own FVG script inspired by Nephew Sam as his fvg code is not open source. My goal is to replicate his Script and then add in alerts and more functions. Thus, i spent few days trying to code. There is bugs such as lower time frame not showing higher time frame FVG.

This script automatically detects and visualizes Fair Value Gaps (FVGs) — imbalances between demand and supply — across multiple timeframes (15-minute, 1-hour, and 4-hour).

15m chart shows:
15m FVGs (green/red boxes)
1H FVGs (lime/maroon)
4H FVGs (faded green/red with borders) (Bugged For now i only see 1H appearing)

1H chart shows:
1H FVGs
4H FVGs

4H chart shows:
4H FVGs only

There is the function to auto close FVG when a future candle fully disrespected it.

You're welcome to:

🔧 Customize the appearance: adjust box colors, transparency, border style

🧪 Add alerts: e.g., when price enters or fills a gap

📅 Expand to Daily/Weekly: just copy the logic and plug in "D" or "W" as new layers

📈 Build confluence logic: combine this with order blocks, liquidity zones, or ICT concepts

🧠 Experiment with entry signals: e.g., candle confirmation on return to FVG

🚀 Improve performance: if you find a lighter way to track gaps, feel free to optimize!

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.