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.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.