OPEN-SOURCE SCRIPT
FVG Clean MTF + IFVG (Deep Memory)

FVG Deep Memory [MTF + Independent History]
This is a highly optimized, Multi-Timeframe (MTF) Fair Value Gap indicator designed to solve the common "data limit" issues found in standard FVG scripts.
Most MTF indicators share a single "memory limit" for all zones. This causes a problem: specific high-frequency zones (like 1-minute gaps) flood the memory and accidentally delete your important Higher Timeframe levels (like Daily or 4H gaps).
FVG Deep Memory solves this by assigning Independent Memory Buckets to each timeframe. Your 1-minute noise will never delete your Daily structure again.
🚀 Key Features
1. "Deep Memory" Architecture
5 Independent Timeframes: Monitor the Chart, 15m, 1h, 4h, and Daily intervals simultaneously.
No Cannibalization: Each timeframe has its own dedicated allocation (e.g., 100 zones each). A flood of new zones on the 15m chart will not erase an old Daily zone. They coexist perfectly.
2. Dynamic "Gray Zone" State
SR Channel Logic: When price enters an active FVG, the zone dynamically changes color to Gray (customizable).
Why it helps: This provides an instant visual cue that price is "in traffic" or a decision point, separating it from untouched "fresh" zones.
3. Advanced Logic
Inversion Gaps (IFVG): When a Fair Value Gap is broken, it can automatically flip into an Inversion Gap (Support becomes Resistance) with a dashed style.
Mitigation Handling: Choose between extending zones until broken, or hiding them immediately upon mitigation to keep the chart clean.
Midlines: Optional median lines for precision entries.
4. Soft UI & Customization
Designed with "Soft" transparency to keep your chart readable.
Fully customizable colors for Bullish, Bearish, and "In-Zone" states.
Toggle any timeframe on/off individually without affecting the logic of others.
🛠 Settings Guide
Lookback Limit: How far back (in days) to scan for gaps.
Max Boxes PER Timeframe: The distinct memory limit for each timeframe bucket.
Show Inversion Gaps: Enables the "Support to Resistance" flip logic.
Hide Nested Gaps: Prevents clutter by merging overlapping zones.
Price In Zone Color: The color the zone turns when price is currently trading inside it.
⚠️ Credits
Original detection logic by LuxAlgo.
Heavily modified by Gemini_AI_Optimization to include Independent Memory Architecture, Gray Zone Logic, and Independent MTF Layering.
This is a highly optimized, Multi-Timeframe (MTF) Fair Value Gap indicator designed to solve the common "data limit" issues found in standard FVG scripts.
Most MTF indicators share a single "memory limit" for all zones. This causes a problem: specific high-frequency zones (like 1-minute gaps) flood the memory and accidentally delete your important Higher Timeframe levels (like Daily or 4H gaps).
FVG Deep Memory solves this by assigning Independent Memory Buckets to each timeframe. Your 1-minute noise will never delete your Daily structure again.
🚀 Key Features
1. "Deep Memory" Architecture
5 Independent Timeframes: Monitor the Chart, 15m, 1h, 4h, and Daily intervals simultaneously.
No Cannibalization: Each timeframe has its own dedicated allocation (e.g., 100 zones each). A flood of new zones on the 15m chart will not erase an old Daily zone. They coexist perfectly.
2. Dynamic "Gray Zone" State
SR Channel Logic: When price enters an active FVG, the zone dynamically changes color to Gray (customizable).
Why it helps: This provides an instant visual cue that price is "in traffic" or a decision point, separating it from untouched "fresh" zones.
3. Advanced Logic
Inversion Gaps (IFVG): When a Fair Value Gap is broken, it can automatically flip into an Inversion Gap (Support becomes Resistance) with a dashed style.
Mitigation Handling: Choose between extending zones until broken, or hiding them immediately upon mitigation to keep the chart clean.
Midlines: Optional median lines for precision entries.
4. Soft UI & Customization
Designed with "Soft" transparency to keep your chart readable.
Fully customizable colors for Bullish, Bearish, and "In-Zone" states.
Toggle any timeframe on/off individually without affecting the logic of others.
🛠 Settings Guide
Lookback Limit: How far back (in days) to scan for gaps.
Max Boxes PER Timeframe: The distinct memory limit for each timeframe bucket.
Show Inversion Gaps: Enables the "Support to Resistance" flip logic.
Hide Nested Gaps: Prevents clutter by merging overlapping zones.
Price In Zone Color: The color the zone turns when price is currently trading inside it.
⚠️ Credits
Original detection logic by LuxAlgo.
Heavily modified by Gemini_AI_Optimization to include Independent Memory Architecture, Gray Zone Logic, and Independent MTF Layering.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.