OPEN-SOURCE SCRIPT
Atualizado Daily Levels: PD / PM / OR (RTH/Pre)

# Daily Levels: PD / PM / OR (RTH/Pre)
## Overview
This indicator displays key intraday support and resistance levels for US equity markets, specifically designed for traders who use Previous Day, Pre-Market, and Opening Range levels in their trading strategy.
## Key Features
**Seven Critical Levels Displayed:**
- **PDH (Previous Day High)** - Blue line: The highest price from yesterday's regular trading hours (9:30 AM - 4:00 PM ET)
- **PDL (Previous Day Low)** - Blue line: The lowest price from yesterday's regular trading hours
- **PDC (Previous Day Close)** - Orange line: The closing price from yesterday's regular trading hours
- **PMH (Pre-Market High)** - Yellow line: The highest price during today's pre-market session (4:00 AM - 9:30 AM ET)
- **PML (Pre-Market Low)** - Yellow line: The lowest price during today's pre-market session
- **ORH (Opening Range High)** - Red line: The highest price during the first 30 minutes of trading (9:30 AM - 10:00 AM ET)
- **ORL (Opening Range Low)** - Red line: The lowest price during the first 30 minutes of trading
## How It Works
**At 9:30 AM ET (Market Open):**
- PDH, PDL, PDC levels appear (from previous day's RTH)
- PMH, PML levels appear (from today's pre-market session)
- All lines begin at the 9:30 AM bar and extend right
**At 10:00 AM ET (Opening Range Close):**
- ORH, ORL levels appear (from today's first 30 minutes)
- Lines begin at the 9:30 AM bar and extend right
**Level Persistence:**
- All levels remain visible until the next trading day at 9:30 AM ET
- Levels reset daily for the new trading session
## Use Cases
**Day Trading:**
- Identify key support and resistance zones before placing trades
- Use PDH/PDL as potential profit targets or stop loss areas
- Monitor price reaction at pre-market levels for early trading signals
- Trade breakouts or rejections at opening range levels
**Swing Trading:**
- Assess daily momentum by observing breaks above/below previous day levels
- Use multiple timeframes while maintaining consistent reference points
**Market Structure:**
- Quickly identify if the market is trading above or below key levels
- Recognize accumulation/distribution patterns around these zones
## Technical Details
- **Timezone:** All times referenced are US Eastern Time (America/New_York)
- **Session Windows:**
- Pre-Market: 4:00 AM - 9:30 AM ET
- Regular Trading Hours: 9:30 AM - 4:00 PM ET
- Opening Range: 9:30 AM - 10:00 AM ET
- **Timeframe Agnostic:** Works on any chart timeframe
- **Visual Clarity:** Color-coded lines and labels for easy identification
## Color Scheme
- **Blue:** Previous Day levels (PDH, PDL)
- **Orange:** Previous Day Close (PDC)
- **Yellow:** Pre-Market levels (PMH, PML)
- **Red:** Opening Range levels (ORH, ORL)
## Best Practices
1. Use on US equity indices (SPY, QQQ, ES, NQ) and liquid US stocks
2. Combine with volume analysis for confirmation
3. Pay attention to how price reacts at these levels (bounce vs. break)
4. Most effective during the first 2 hours of trading when volatility is highest
5. Consider the market context (trending vs. ranging) when interpreting these levels
## Note
This indicator is specifically designed for US market hours. Results may vary when applied to international markets or instruments with different trading sessions.
## Overview
This indicator displays key intraday support and resistance levels for US equity markets, specifically designed for traders who use Previous Day, Pre-Market, and Opening Range levels in their trading strategy.
## Key Features
**Seven Critical Levels Displayed:**
- **PDH (Previous Day High)** - Blue line: The highest price from yesterday's regular trading hours (9:30 AM - 4:00 PM ET)
- **PDL (Previous Day Low)** - Blue line: The lowest price from yesterday's regular trading hours
- **PDC (Previous Day Close)** - Orange line: The closing price from yesterday's regular trading hours
- **PMH (Pre-Market High)** - Yellow line: The highest price during today's pre-market session (4:00 AM - 9:30 AM ET)
- **PML (Pre-Market Low)** - Yellow line: The lowest price during today's pre-market session
- **ORH (Opening Range High)** - Red line: The highest price during the first 30 minutes of trading (9:30 AM - 10:00 AM ET)
- **ORL (Opening Range Low)** - Red line: The lowest price during the first 30 minutes of trading
## How It Works
**At 9:30 AM ET (Market Open):**
- PDH, PDL, PDC levels appear (from previous day's RTH)
- PMH, PML levels appear (from today's pre-market session)
- All lines begin at the 9:30 AM bar and extend right
**At 10:00 AM ET (Opening Range Close):**
- ORH, ORL levels appear (from today's first 30 minutes)
- Lines begin at the 9:30 AM bar and extend right
**Level Persistence:**
- All levels remain visible until the next trading day at 9:30 AM ET
- Levels reset daily for the new trading session
## Use Cases
**Day Trading:**
- Identify key support and resistance zones before placing trades
- Use PDH/PDL as potential profit targets or stop loss areas
- Monitor price reaction at pre-market levels for early trading signals
- Trade breakouts or rejections at opening range levels
**Swing Trading:**
- Assess daily momentum by observing breaks above/below previous day levels
- Use multiple timeframes while maintaining consistent reference points
**Market Structure:**
- Quickly identify if the market is trading above or below key levels
- Recognize accumulation/distribution patterns around these zones
## Technical Details
- **Timezone:** All times referenced are US Eastern Time (America/New_York)
- **Session Windows:**
- Pre-Market: 4:00 AM - 9:30 AM ET
- Regular Trading Hours: 9:30 AM - 4:00 PM ET
- Opening Range: 9:30 AM - 10:00 AM ET
- **Timeframe Agnostic:** Works on any chart timeframe
- **Visual Clarity:** Color-coded lines and labels for easy identification
## Color Scheme
- **Blue:** Previous Day levels (PDH, PDL)
- **Orange:** Previous Day Close (PDC)
- **Yellow:** Pre-Market levels (PMH, PML)
- **Red:** Opening Range levels (ORH, ORL)
## Best Practices
1. Use on US equity indices (SPY, QQQ, ES, NQ) and liquid US stocks
2. Combine with volume analysis for confirmation
3. Pay attention to how price reacts at these levels (bounce vs. break)
4. Most effective during the first 2 hours of trading when volatility is highest
5. Consider the market context (trending vs. ranging) when interpreting these levels
## Note
This indicator is specifically designed for US market hours. Results may vary when applied to international markets or instruments with different trading sessions.
Notas de Lançamento
Key Updates1. Fixed Level Reset Timing
Problem: The script was resetting Previous Day levels immediately after RTH ended (4:00 PM), preparing for the next day too early
Solution: Added a staging system where RTH data is saved when the session ends, but Previous Day levels only update at 9:30 AM ET when the market actually opens
Result: PDH/PDL/PDC now remain stable throughout after-hours and pre-market, only updating when the new trading day begins
2. Added Display Toggle Settings
Added checkboxes in indicator settings to show/hide each level pair:
Show Previous Day (PDH/PDL) - High and Low from previous RTH session
Show Previous Day Close (PDC) - Close from previous RTH session
Show Pre-Market (PMH/PML) - High and Low from 4:00-9:30 AM ET
Show Opening Range (ORH/ORL) - High and Low from opening range period
All are enabled by default but can be toggled off individually
3. Added Opening Range Duration Option
Added a dropdown setting to choose Opening Range duration:
30 minutes: 9:30 AM - 10:00 AM ET (default)
60 minutes: 9:30 AM - 10:30 AM ET
OR levels lock in at either 10:00 AM or 10:30 AM based on selection
Notas de Lançamento
Updated sample ticker (SPY) to only show indicator described.Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.