OPEN-SOURCE SCRIPT
Premium & Discount Matrix

1. Dynamic Intraday Dealing Range
The core of the PD Matrix is the "dealing range." The script calculates this by finding the absolute highest high and lowest low of the current daily session:
It automatically detects when a new day begins.
As the day progresses and price creates new highs or lows, the script dynamically updates the top and bottom boundaries in real-time.
2. Matrix Box & Equilibrium
Once the dealing range is established, it draws the matrix components:
The Box: It draws a single, fully transparent rectangle around the entire daily range. The background is completely clear so it doesn't obstruct your candlesticks, and only the outer border is visible.
Equilibrium (50%): It automatically calculates the exact mathematical midpoint of the daily high and low. It then draws a dashed line straight through the middle of the box to represent the 50% Equilibrium level.
3. Smart Market Labeling
To make the zones instantly readable, the script places three floating text labels neatly to the right of your current live candle. These labels move with the price action:
Premium (Red): Positioned in the upper half (above 50%). According to ICT concepts, this is expensive pricing where institutional algorithms seek to distribute (sell short).
Eq (50%) (Gray): Points directly to the dashed equilibrium line, representing fair value.
Discount (Green): Positioned in the lower half (below 50%). This is cheap pricing where institutional algorithms seek to accumulate (buy long).
4. Customization & Performance
Like the previous script, this is highly optimized for TradingView. It uses a single dynamic box, a single line, and three labels that constantly update on the very last bar, preventing your chart from being cluttered with hundreds of historical drawings.
You can fully customize the colors of the box border, the equilibrium line, and all three text labels directly from the indicator settings!
The core of the PD Matrix is the "dealing range." The script calculates this by finding the absolute highest high and lowest low of the current daily session:
It automatically detects when a new day begins.
As the day progresses and price creates new highs or lows, the script dynamically updates the top and bottom boundaries in real-time.
2. Matrix Box & Equilibrium
Once the dealing range is established, it draws the matrix components:
The Box: It draws a single, fully transparent rectangle around the entire daily range. The background is completely clear so it doesn't obstruct your candlesticks, and only the outer border is visible.
Equilibrium (50%): It automatically calculates the exact mathematical midpoint of the daily high and low. It then draws a dashed line straight through the middle of the box to represent the 50% Equilibrium level.
3. Smart Market Labeling
To make the zones instantly readable, the script places three floating text labels neatly to the right of your current live candle. These labels move with the price action:
Premium (Red): Positioned in the upper half (above 50%). According to ICT concepts, this is expensive pricing where institutional algorithms seek to distribute (sell short).
Eq (50%) (Gray): Points directly to the dashed equilibrium line, representing fair value.
Discount (Green): Positioned in the lower half (below 50%). This is cheap pricing where institutional algorithms seek to accumulate (buy long).
4. Customization & Performance
Like the previous script, this is highly optimized for TradingView. It uses a single dynamic box, a single line, and three labels that constantly update on the very last bar, preventing your chart from being cluttered with hundreds of historical drawings.
You can fully customize the colors of the box border, the equilibrium line, and all three text labels directly from the indicator settings!
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.