OPEN-SOURCE SCRIPT
Cập nhật PD Arrays Matrix

This script is arguably the most comprehensive script in this workspace. It acts as an algorithmic footprint scanner, actively mapping the entire spectrum of ICT "Premium/Discount Arrays" on your chart in real-time.
Because charting all these footprint concepts can get incredibly cluttered, it features a built-in memory management system, a Lookback Period optimizer (to only track recent data), and toggle switches for every single array type in the settings menu.
Here is exactly what the script detects, draws, and manages:
1. Fair Value Gaps (FVGs) & Consequent Encroachment (CE)
BISI (Buyside Imbalance Sellside Inefficiency): A Bullish FVG. Drawn as a green box when a massive up-move leaves a 3-candle gap.
SIBI (Sellside Imbalance Buyside Inefficiency): A Bearish FVG. Drawn as a red box during a massive down-move.
CE (Consequent Encroachment): It automatically calculates and draws a dotted midline perfectly through the 50% equilibrium mark of every active FVG, which algos use for precise mitigation.
2. Inversion FVGs (IFVG)
The script actively monitors the life-cycle of every FVG. If a Bullish FVG fails to support price and a candle closes completely below it, the script intelligently flips its polarity.
It turns into a Bearish Resistance zone (colored red/gray) labeled IFVG, extending into the future.
3. Balanced Price Ranges (BPR)
A highly sensitive algorithmic signature. If the script detects that a new Bearish FVG has formed and perfectly overlaps the price range of an older Bullish FVG, it highlights that specific overlapping zone in yellow. This acts as a massive magnet/rejection zone for future price action.
4. Volume Imbalance (VI)
Detects microscopic inefficiencies. If two consecutive candles gap up or down so heavily that their bodies do not overlap at all, but their wicks do touch, the script draws a small purple VI zone between the bodies.
5. Order Blocks (OB)
To filter out low-probability order blocks, the script mathematically enforces the Displacement Rule. It will only flag an institutional down-candle (+OB) or up-candle (-OB) if it immediately precedes a move impulsive enough to leave behind an FVG.
6. Breaker Blocks (+BRK/-BRK) & Mitigation Blocks (MB)
The script monitors the life-cycle of Order Blocks! When an Order Block fails and price breaks aggressively through it, the algorithm checks the previous swing structure:
Did price sweep liquidity (a higher high / lower low) before breaking the OB? If yes, it flips the failed OB into a Breaker Block, turning support into resistance.
Did price fail to sweep liquidity? If yes, it flips it into a Mitigation Block.
7. Rejection Blocks
It scans the chart for unusually long institutional wicks (specifically, wicks that are more than double the size of the candle body and statistically significant relative to the ATR).
When found, it draws a block from the open/close of the candle body out to the extreme tip of the wick, highlighting where institutional accumulation or distribution took place off-screen.
Because charting all these footprint concepts can get incredibly cluttered, it features a built-in memory management system, a Lookback Period optimizer (to only track recent data), and toggle switches for every single array type in the settings menu.
Here is exactly what the script detects, draws, and manages:
1. Fair Value Gaps (FVGs) & Consequent Encroachment (CE)
BISI (Buyside Imbalance Sellside Inefficiency): A Bullish FVG. Drawn as a green box when a massive up-move leaves a 3-candle gap.
SIBI (Sellside Imbalance Buyside Inefficiency): A Bearish FVG. Drawn as a red box during a massive down-move.
CE (Consequent Encroachment): It automatically calculates and draws a dotted midline perfectly through the 50% equilibrium mark of every active FVG, which algos use for precise mitigation.
2. Inversion FVGs (IFVG)
The script actively monitors the life-cycle of every FVG. If a Bullish FVG fails to support price and a candle closes completely below it, the script intelligently flips its polarity.
It turns into a Bearish Resistance zone (colored red/gray) labeled IFVG, extending into the future.
3. Balanced Price Ranges (BPR)
A highly sensitive algorithmic signature. If the script detects that a new Bearish FVG has formed and perfectly overlaps the price range of an older Bullish FVG, it highlights that specific overlapping zone in yellow. This acts as a massive magnet/rejection zone for future price action.
4. Volume Imbalance (VI)
Detects microscopic inefficiencies. If two consecutive candles gap up or down so heavily that their bodies do not overlap at all, but their wicks do touch, the script draws a small purple VI zone between the bodies.
5. Order Blocks (OB)
To filter out low-probability order blocks, the script mathematically enforces the Displacement Rule. It will only flag an institutional down-candle (+OB) or up-candle (-OB) if it immediately precedes a move impulsive enough to leave behind an FVG.
6. Breaker Blocks (+BRK/-BRK) & Mitigation Blocks (MB)
The script monitors the life-cycle of Order Blocks! When an Order Block fails and price breaks aggressively through it, the algorithm checks the previous swing structure:
Did price sweep liquidity (a higher high / lower low) before breaking the OB? If yes, it flips the failed OB into a Breaker Block, turning support into resistance.
Did price fail to sweep liquidity? If yes, it flips it into a Mitigation Block.
7. Rejection Blocks
It scans the chart for unusually long institutional wicks (specifically, wicks that are more than double the size of the candle body and statistically significant relative to the ATR).
When found, it draws a block from the open/close of the candle body out to the extreme tip of the wick, highlighting where institutional accumulation or distribution took place off-screen.
Phát hành các Ghi chú
Updated customization for every each elements and feature for PD Array MatrixMã 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.