OPEN-SOURCE SCRIPT
Previous Day High / Low

It marks three price levels from yesterday's session and holds them on the chart as horizontal reference lines.
**What it plots**
PDH and PDL are the previous day's high and low, drawn as solid light-blue lines at width 3. PDM sits halfway between them, dotted and light yellow. All three extend infinitely in both directions, so they're visible no matter where you scroll.
**How the values are pulled**
A single `request.security` call fetches `high[1]` and `low[1]` off the daily series. Because it references the bar *before* the current daily bar, the values are locked in from a session that has already closed. `lookahead_on` is safe in that context and nothing repaints intraday. Mid is just the average of the two.
There's an RTH toggle. Left off, you get the full Globex range on futures. Switched on, `ticker.modify` swaps to the regular session so the levels come from 8:30–3:00 CT only.
**How it draws**
Rather than creating new line objects each session, it makes six objects once (three lines, three labels) and repositions them on the last bar. That's why it runs on any timeframe and why the lines are continuous instead of segmented per day. Labels sit three bars right of the last candle showing the level name and price.
**Alerts**
Two conditions fire on a close crossing PDH or PDL, in either direction.
**Practical use for MNQ**
These are the levels a lot of order flow references at the open. Yesterday's high and low act as the obvious liquidity pools, and the midpoint often works as a mean-reversion magnet when the session opens inside the prior range. Given your 9/21 EMA stack, the useful reads are when a level lines up with the fast EMAs, and when price opens outside the prior range entirely, since that changes whether PDH/PDL are targets or support.
**What it plots**
PDH and PDL are the previous day's high and low, drawn as solid light-blue lines at width 3. PDM sits halfway between them, dotted and light yellow. All three extend infinitely in both directions, so they're visible no matter where you scroll.
**How the values are pulled**
A single `request.security` call fetches `high[1]` and `low[1]` off the daily series. Because it references the bar *before* the current daily bar, the values are locked in from a session that has already closed. `lookahead_on` is safe in that context and nothing repaints intraday. Mid is just the average of the two.
There's an RTH toggle. Left off, you get the full Globex range on futures. Switched on, `ticker.modify` swaps to the regular session so the levels come from 8:30–3:00 CT only.
**How it draws**
Rather than creating new line objects each session, it makes six objects once (three lines, three labels) and repositions them on the last bar. That's why it runs on any timeframe and why the lines are continuous instead of segmented per day. Labels sit three bars right of the last candle showing the level name and price.
**Alerts**
Two conditions fire on a close crossing PDH or PDL, in either direction.
**Practical use for MNQ**
These are the levels a lot of order flow references at the open. Yesterday's high and low act as the obvious liquidity pools, and the midpoint often works as a mean-reversion magnet when the session opens inside the prior range. Given your 9/21 EMA stack, the useful reads are when a level lines up with the fast EMAs, and when price opens outside the prior range entirely, since that changes whether PDH/PDL are targets or support.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.