Prior Day High, Low, and Settlement
This indicator plots the high, low, and closing price from the previous trading day as horizontal reference lines on the current chart. Intraday traders use these levels to identify pivot points and potential support or resistance. Day traders often treat yesterday's high and low as natural areas where price may pause or reverse; the settlement (close) serves as a baseline for measuring overnight gaps and session bias.
//@version=6
indicator("Prior Day OHLC Levels", overlay=true)
// Inputs
input_colorHigh = input.color(color.new(color.green, 80), "High color")
input_colorLow = input.color(color.new(color.red, 80), "Low color")
input_colorSettle = input.color(color.new(color.blue, 80), "Settlement color")
input_styleHigh = input.string("Dashed", "High style", options=["Solid", "Dashed", "Dotted"])
input_styleLow = input.string("Dashed", "Low style", options=["Solid", "Dashed", "Dotted"])
input_styleSettle = input.string("Solid", "Settlement style", options=["Solid", "Dashed", "Dotted"])
input_width = input.int(1, "Line width", minval=1, maxval=5)
// Convert string input to linestyle
f_lineStyle(style) =>
style == "Solid" ? line.style_solid : style == "Dashed" ? line.style_dashed : line.style_dotted
// Fetch prior day's OHLC on daily timeframe
priorHigh = request.security(syminfo.tickerid, "D", high[1])
priorLow = request.security(syminfo.tickerid, "D", low[1])
priorClose = request.security(syminfo.tickerid, "D", close[1])
// Plot on chart
plot(priorHigh, title="Prior Day High", color=input_colorHigh, linewidth=input_width,
style=f_lineStyle(input_styleHigh))
plot(priorLow, title="Prior Day Low", color=input_colorLow, linewidth=input_width,
style=f_lineStyle(input_styleLow))
plot(priorClose, title="Prior Day Settlement", color=input_colorSettle, linewidth=input_width,
style=f_lineStyle(input_styleSettle))
How the code works
The indicator uses request.security() to fetch daily timeframe data on a one-bar offset ([1](#ref-1)). This retrieves yesterday's high, low, and close regardless of which intraday timeframe the chart itself displays. The f_lineStyle() helper function converts the string inputs into Pine line style constants so users can choose solid, dashed, or dotted appearance for each level independently.
Each of the three price levels is plotted as a separate line with independent color, style, and width settings. The color input uses color.new() with transparency (the second argument, 0-100) to allow the lines to blend slightly with price action without obscuring the candlesticks.
Reading it on a chart
Traders watch for price reactions at these three levels during the current session. The prior day's high often acts as an intraday resistance; a close above it signals strength and can trigger breakout momentum. The prior day's low typically provides support; failure to hold it can signal weakness. The settlement line sits between them and provides context: if the current open is well above yesterday's close, the session has a bullish gap; if it opens well below, there is a bearish gap.
More experienced traders layer these reference levels with support-resistance analysis or volume-weighted price data to refine entry and exit timing. The visual simplicity of three horizontal lines makes them easy to spot on a crowded chart.
Limitations
The indicator assumes markets trade on a regular daily cycle; in markets that close for weekends or holidays, the "prior day" may be 2-3 calendar days ago. Users working with crypto or forex that trade 24/5 will not see gaps between settlement and open on Mondays, whereas equity traders will.
The term "settlement" here is the daily close, which may not match the actual settlement price in futures or options markets. For example, in equity index futures, settlement is often defined by the opening print of the underlying cash market on the following morning, not the prior day's futures close. Futures traders must verify that Pine's close[1](#ref-1) on daily bars aligns with their broker's settlement definition.
Plotting fixed levels from the prior day can anchor trader behavior, leading to self-fulfilling reversals at round numbers but also creating false breakouts if momentum is strong. Over-reliance on these levels without volume or volatility context often results in stops being run through or failed breakouts.
The indicator repaints only if the input timeframe is daily or lower; on hourly or minute charts applied to a daily symbol, it will not repaint.
Key definitions
Prior trading day: The most recent complete market session before the current one, whether one or multiple calendar days before depending on weekend or holiday breaks.
Support level: A price region where falling price historically pauses or reverses, often attracting buyers.
Resistance level: A price region where rising price historically pauses or reverses, often attracting sellers.
Settlement: The official closing price of a security, used to mark the end of the trading session and as the basis for next-day calculations.
Gap: The difference between today's opening price and the prior day's closing price when they are not equal.
Intraday timeframe: A chart period shorter than one day, such as 1-minute, 5-minute, 15-minute, hourly, or 4-hourly.
References
- CME Group, "Equity Index Futures Contract Specifications", https://www.cmegroup.com/markets/indices.html
- FINRA, "Understanding Settlement", https://www.finra.org/investors/insights/understanding-settlement
- Investopedia, "Support and Resistance Levels", https://www.investopedia.com/terms/s/support.asp
- TradingView, "Pine Script Reference Manual v6", https://www.tradingview.com/pine-script-reference/
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-10-04. Educational research on historical data, not financial advice.
Keep reading
Swing Structure: BOS & CHoCH Marker
Free open-source Pine Script indicator: swing high/low structure marker (BOS and CHoCH labels). Full code and a plain-English walkthrough.
Seasonality Heat Strip: Month-of-Year Average Returns
Free open-source Pine Script indicator: seasonality heat strip: month-of-year average returns. Full code and a plain-English walkthrough.
Spread Tracker: Futures Pair
Free open-source Pine Script indicator: spread tracker between two related futures contracts. Full code and a plain-English walkthrough.