OPEN-SOURCE SCRIPT
Dynamic Mitigation Imbalances - Price Invasion Tracking

### Overview
This closed-source indicator introduces a novel methodology for tracking market inefficiencies (Imbalances / Fair Value Gaps) by incorporating a real-time, price-action-driven dynamic resizing mechanism. Unlike conventional FVG indicators that keep blocks static until full mitigation or delete them abruptly upon a simple touch, this script visually "consumes" and shrinks the historical boxes proportionally to price invasion.
### Core Logic & Mathematical Concepts
The script scans consecutive candle sequences to detect structurally significant displacement zones:
- **Bearish Imbalances:** Identified when a green candle sequence encounters a red sequence, and the lowest low of the green origin remains completely above the high of the current corrective development.
- **Bullish Imbalances:** Identified when a red candle sequence meets a green sequence, leaving a price gap where the highest high of the red origin remains below the low of the current corrective development.
### The Innovation: Dynamic Consumption
The cornerstone of this script is its dynamic recalculation engine via arrays:
1. **Original Metrics Storage:** The script memorizes the absolute height (size) of the original inefficiency upon creation.
2. **Invasion Tracking:** As subsequent candles develop, the script monitors intra-bar tracking (`high[0]` for bearish zones, `low[0]` for bullish zones). If the price breaches the box limits, the dimensions are recalculated on the fly (`box.set_bottom()` / `box.set_top()`), visually shrinking the box area.
3. **Percentage-Based Elimination Threshold:** Through an adjustable input parameter (`pctMitigacion`), users can establish an exact percentage threshold (e.g., 95%). The indicator actively calculates:
Remaining Size <= Original Size * (1.0 - Mitigation Factor)
Once this threshold is breached, the script efficiently flushes the box data from memory.
### How to Use
- **Visualizing Inefficiencies:** Broad zones display active, unmitigated market gaps.
- **Shrinking Boxes:** A shrinking box indicates institutional orders are actively filling the liquidity vacuum.
- **Execution Areas:** The remaining unmitigated fractions of the boxes serve as highly precise refined zones for entry or risk management.
This closed-source indicator introduces a novel methodology for tracking market inefficiencies (Imbalances / Fair Value Gaps) by incorporating a real-time, price-action-driven dynamic resizing mechanism. Unlike conventional FVG indicators that keep blocks static until full mitigation or delete them abruptly upon a simple touch, this script visually "consumes" and shrinks the historical boxes proportionally to price invasion.
### Core Logic & Mathematical Concepts
The script scans consecutive candle sequences to detect structurally significant displacement zones:
- **Bearish Imbalances:** Identified when a green candle sequence encounters a red sequence, and the lowest low of the green origin remains completely above the high of the current corrective development.
- **Bullish Imbalances:** Identified when a red candle sequence meets a green sequence, leaving a price gap where the highest high of the red origin remains below the low of the current corrective development.
### The Innovation: Dynamic Consumption
The cornerstone of this script is its dynamic recalculation engine via arrays:
1. **Original Metrics Storage:** The script memorizes the absolute height (size) of the original inefficiency upon creation.
2. **Invasion Tracking:** As subsequent candles develop, the script monitors intra-bar tracking (`high[0]` for bearish zones, `low[0]` for bullish zones). If the price breaches the box limits, the dimensions are recalculated on the fly (`box.set_bottom()` / `box.set_top()`), visually shrinking the box area.
3. **Percentage-Based Elimination Threshold:** Through an adjustable input parameter (`pctMitigacion`), users can establish an exact percentage threshold (e.g., 95%). The indicator actively calculates:
Remaining Size <= Original Size * (1.0 - Mitigation Factor)
Once this threshold is breached, the script efficiently flushes the box data from memory.
### How to Use
- **Visualizing Inefficiencies:** Broad zones display active, unmitigated market gaps.
- **Shrinking Boxes:** A shrinking box indicates institutional orders are actively filling the liquidity vacuum.
- **Execution Areas:** The remaining unmitigated fractions of the boxes serve as highly precise refined zones for entry or risk management.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.