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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。