Prior Day High, Low, and Settlement
Day traders and swing traders often reference the prior trading session's high, low, and closing prices to anchor entries, exits, and stop-loss levels. These reference points act as psychological and technical support or resistance because they represent completed market activity and are easy to calculate across multiple participants. This indicator plots those three levels from the prior day on the current chart, allowing traders to see yesterday's range and close at a glance.
//@version=6
indicator("Prior Day High/Low/Settlement", overlay=true)
// Input controls
colorHigh = input.color(color.new(color.red, 70), "Prior Day High Color")
colorLow = input.color(color.new(color.blue, 70), "Prior Day Low Color")
colorSettlement = input.color(color.new(color.gray, 70), "Prior Day Settlement Color")
lineWidth = input.int(1, "Line Width", minval=1, maxval=3)
lineStyle = input.string("Solid", "Line Style", options=["Solid", "Dashed", "Dotted"])
// Retrieve previous day's high, low, and close using daily timeframe
prevDayHigh = request.security(syminfo.tickerid, "D", high[1])
prevDayLow = request.security(syminfo.tickerid, "D", low[1])
prevDaySettlement = request.security(syminfo.tickerid, "D", close[1])
// Convert line style input to chart constant
lineStyleConstant = lineStyle == "Dashed" ? chart.linestyle_dashed :
lineStyle == "Dotted" ? chart.linestyle_dotted :
chart.linestyle_solid
// Plot the three levels
plot(prevDayHigh, "Prior Day High", color=colorHigh, linewidth=lineWidth, linestyle=lineStyleConstant)
plot(prevDayLow, "Prior Day Low", color=colorLow, linewidth=lineWidth, linestyle=lineStyleConstant)
plot(prevDaySettlement, "Prior Day Settlement", color=colorSettlement, linewidth=lineWidth, linestyle=lineStyleConstant)
How the code works
The indicator uses request.security() to fetch the daily timeframe's OHLC data from the previous session. The high[1](#ref-1), low[1](#ref-1), and close[1](#ref-1) references point to the bar index from one day ago, isolating the prior session's extremes and close price. By specifying "D" as the timeframe argument, the function automatically converts intraday charts to daily resolution regardless of whether the chart itself displays 1-minute, 5-minute, or hourly bars.
Three plot() calls render these levels as overlaid horizontal lines. Each line's color, width, and style (solid, dashed, or dotted) are user-configurable via input controls, allowing traders to customize the visual appearance for their preferences or screen setup. The overlay=true parameter places these lines directly on the price chart rather than in a separate panel.
Reading it on a chart
Traders typically reference prior day levels in four scenarios: (1) opening gaps above or below yesterday's high/low indicate directional bias or breakout conditions; (2) price pullbacks to yesterday's close or high/low can serve as defined entry or exit zones; (3) tight clustering near yesterday's settlement at market open suggests indecision; and (4) overnight gap-and-go moves that hold the previous day's range often consolidate before the next breakout. The settlement line is particularly useful for intraday traders, as it represents the consensus price from the last session and sometimes acts as a pivot around which price oscillates early in the following session.
The spacing between the three lines, the prior day's range, gives a visual sense of yesterday's volatility. A wide range suggests strong directional movement; a narrow range indicates consolidation. These observations inform the type of trading activity to expect during the current session.
Limitations
This indicator has several important constraints. First, the levels reposition at every new daily bar, so on the first tick of a new trading day, the plots show only the prior session's reference points. Second, traders must manually remember or note levels from multiple prior days; the indicator shows only yesterday's data, not a rolling history. Users who need to see the past week or month of daily high/low/close levels should use multiple instances of this script with different offset values or look to alternative multi-level indicators.
Third, the indicator assumes the exchange and market have consistent daily sessions. For markets with extended hours or irregular holiday schedules, the "previous day" may skip a session or capture extended trading hours depending on how the charting software defines the daily bar boundary. Crypto and other 24/5 or 24/7 markets require careful interpretation of what "day" means in a given context.
Fourth, visual interpretation is subjective. Prior day levels are neither guaranteed support or resistance nor predictive of price action; they are merely reference points that traders and algorithms may notice. Price may gap through or bounce off these levels without pattern or predictability. No historical study supports the claim that trading off prior day levels alone generates consistent edge. Traders should combine this information with other methods and risk management discipline.
Finally, the indicator works only on charts with a timeframe of one day or longer. On sub-daily charts (minutes, hours), the daily security call will repeat the same value across many bars, which is correct but can create a false sense of multiple distinct price events. This is not an error; it reflects the fact that intraday bars do not create new daily high/low/settlement values until the daily bar closes.
Key definitions
Prior Day High: the highest price traded during the previous complete trading session (typically the last calendar day for equities, or the most recent 24-hour period for other assets).
Prior Day Low: the lowest price traded during the previous complete trading session.
Prior Day Settlement (Close): the closing price of the previous trading session, also called the settlement price; in liquid markets, it reflects the final consensus price at session end.
Support and Resistance: price levels where buying or selling interest historically clusters, causing price to pause or reverse; support is a level where falling price has previously bounced, and resistance is a level where rising price has previously stalled.
Overlay: a plot drawn directly on the main price chart rather than in a separate sub-panel or window, allowing reference levels and price bars to be compared visually without scrolling.
References
-
TradingView, "Pine Script Reference Manual, request.security()", TradingView Documentation. Https://www.tradingview.com/pine-script-reference/ (2024).
-
CME Group, "E-mini S&P 500 Futures Contract Specifications", CME Group. Https://www.cmegroup.com (2024).
-
Nassim N. Taleb, "Fooled by Randomness: The Hidden Role of Chance in Life and in the Markets", Random House (2001).
Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.
Last reviewed by the PropLedger research pipeline: 2026-11-29. Educational research on historical data, not financial advice.
Keep reading
Futures Spread Tracker
Free open-source Pine Script indicator: spread tracker between two related futures contracts. Full code and a plain-English walkthrough.
Early Session Trend/Range Day Classifier
Free open-source Pine Script indicator: trend day vs range day classifier (early session heuristics). Full code and a plain-English walkthrough.
Breadth Proxy: New Highs/New Lows Index
Free open-source Pine Script indicator: new high/new low breadth proxy for a symbol basket. Full code and a plain-English walkthrough.