OPEN-SOURCE SCRIPT

Current & Prior Day OHLC Levels

382
# Current & Prior Day OHLC Levels with 15-Minute Opening Range

## Overview

This comprehensive indicator plots key price levels for futures and stock traders, displaying Current Day levels, Prior Day levels, and the 15-Minute Opening Range. These levels serve as critical support and resistance zones that professional traders monitor throughout the trading session.

## Key Features

### Current Day Levels (Session-Based)
- **Current Open**: The opening price of the current trading session
- **Current High**: The highest price reached during the current session (updates in real-time)
- **Current Low**: The lowest price reached during the current session (updates in real-time)

The indicator properly recognizes **futures trading sessions**, which begin at their respective session start times (not midnight). For example, most equity index futures sessions begin at 6:00 PM ET the previous day, ensuring accurate session-based tracking for overnight and globex trading.

### Prior Day Levels
- **Prior Open**: Opening price from the previous trading session
- **Prior High**: High of the previous trading session
- **Prior Low**: Low of the previous trading session
- **Prior Close**: Closing price from the previous trading session

Prior day levels are some of the most widely watched technical levels in trading, often acting as psychological support and resistance zones where price action tends to react.

### 15-Minute Opening Range (NY Session)
- **OR High**: The high of the first 15 minutes after New York market open (9:30-9:45 AM ET)
- **OR Low**: The low of the first 15 minutes after New York market open (9:30-9:45 AM ET)

The opening range concept is a popular day trading strategy. The first 15 minutes often establishes the tone for the day, with these levels frequently serving as breakout or breakdown points. The indicator tracks these levels in real-time as they form, then locks them in after 9:45 AM ET.

## Visual Design

### Smart Line Extension
- Lines extend **left** to the exact bar that created each level (e.g., the bar that made the high)
- Lines extend **right** by a configurable number of bars (default: 50 bars)
- No infinite line extension cluttering your chart

### Intelligent Label Placement
- Labels positioned **above** highs and opens
- Labels positioned **below** lows
- Adjustable offset to position labels optimally for your timeframe
- Optional price display in labels (e.g., "Current High: 5,950.00")
- Semi-transparent label backgrounds for clean chart appearance

## Customization Options

### Individual Level Controls
Each level (Current Open, High, Low, Prior Open, High, Low, Close, OR High, OR Low) can be:
- Toggled on/off independently
- Assigned a custom color
- Given its own line style (Solid, Dashed, or Dotted)
- Adjusted for line width (1-5 pixels)

### Default Styling
- **Current Day**: Solid lines (Gold for Open, Green for High, Red for Low)
- **Prior Day**: Dashed lines (Steel Blue for Open, Dark Cyan for High, Crimson for Low, Slate Blue for Close)
- **Opening Range**: Dotted lines (Cyan for High, Tomato for Low)

This default styling provides clear visual distinction between level types while remaining professional and easy to read.

### Label Customization
- Toggle all labels on/off
- Show or hide price values in labels
- Adjust label offset (distance from current bar)
- Five label size options: Tiny, Small, Normal, Large, Huge

### Line Extension Control
- Configurable right extension (0-500 bars)
- Adjust based on your chart timeframe and preference

## Best Use Cases

### Futures Traders
The indicator's session-aware design makes it perfect for futures markets, properly handling:
- Electronic trading hours (Globex)
- Session rollovers at 5:00 PM or 6:00 PM ET (depending on contract)
- Overnight price action

### Day Traders
- Use Opening Range levels for breakout/breakdown strategies
- Monitor Current High/Low for intraday trend identification
- Watch Prior Day levels for profit targets and stop placement

### Swing Traders
- Prior Day High/Low often act as key decision points
- Prior Close serves as an important reference level
- Current Day levels help with intraday entry/exit timing

### Multi-Timeframe Analysis
Works on any intraday timeframe:
- 1-minute for scalping
- 5-minute for active day trading
- 15-minute or 30-minute for swing entries
- 1-hour for position context

## Technical Details

### Session Detection
- Uses TradingView's built-in session detection for accurate daily boundaries
- Properly handles futures contracts with non-midnight session starts
- New York timezone detection for Opening Range (9:30 AM ET)

### Real-Time Updates
- Current High and Low update dynamically as price moves
- Opening Range levels update live during the 9:30-9:45 AM window
- Lines redraw on each bar to maintain accurate positioning

### Performance
- Maximum 500 lines and 500 labels to ensure smooth chart performance
- Efficient line/label deletion and recreation on session changes
- Minimal computational overhead

## Tips for Optimal Use

1. **Adjust Line Extension**: For lower timeframes (1-min, 5-min), reduce right extension to 20-30 bars. For higher timeframes (1-hour), increase to 100+ bars.

2. **Combine with Price Action**: These levels work best when combined with candlestick patterns, volume analysis, and order flow.

3. **Watch for Level Tests**: Price often tests these levels multiple times before breaking through or reversing.

4. **Opening Range Breakouts**: Many traders wait for price to break and close above OR High or below OR Low before entering directional trades.

5. **Prior Day Levels as Targets**: Use Prior High as an upside target and Prior Low as a downside target for intraday trades.

## Compatibility

- Works on all instruments (Futures, Stocks, Forex, Crypto)
- Optimized for intraday timeframes (1-min to 1-hour)
- Best results on liquid instruments with clear session boundaries
- Designed specifically with ES, NQ, YM, and RTY futures traders in mind

## Credits

Ported from NinjaTrader indicators with enhanced features and TradingView-specific optimizations. Original concept based on classic technical analysis principles used by professional traders worldwide.

---

*Note: These levels are for informational and educational purposes only. Past performance does not guarantee future results. Always practice proper risk management.*

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.