Paste this Pine Script v6 indicator into TradingView's Pine Editor, save it and add it to a standard 60-minute chart. Choose three exchange-qualified symbols in Settings. The daily calculations run separately for each symbol. Nested > 0 means the reported daily bar is inside its predecessor; Mother run > 0 means it remains inside the retained mother. Green rows identify the latter condition. The default tickers are examples, not recommendations.
Three explicit symbol inputs; completed daily ranges; strict containment by default. Syntax checked with Pineify on 2026-10-17.pine
//@version=6
indicator("Inside-bar list: completed daily bars", overlay = true)
bool allowEqual = input.bool(false, "Allow equal highs/lows")
string ticker1 = input.symbol("NASDAQ:AAPL", "Symbol 1")
string ticker2 = input.symbol("NASDAQ:MSFT", "Symbol 2")
string ticker3 = input.symbol("NASDAQ:NVDA", "Symbol 3")
if not timeframe.isintraday or timeframe.in_seconds() >= timeframe.in_seconds("1D")
runtime.error("Use a standard intraday chart, such as 60 minutes.")
inside(float h, float l, float mh, float ml) =>
allowEqual ? h <= mh and l >= ml : h < mh and l > ml
scan() =>
var float motherHigh = na
var float motherLow = na
var int motherRun = 0
var int nestedRun = 0
bool pairInside = not na(high[1]) and inside(high, low, high[1], low[1])
nestedRun := pairInside ? nestedRun + 1 : 0
if na(motherHigh) or not inside(high, low, motherHigh, motherLow)
motherHigh := high
motherLow := low
motherRun := 0
else
motherRun += 1
[nestedRun[1], motherRun[1], motherHigh[1], motherLow[1], time[1], not na(high[2])]
[n1, r1, h1, l1, t1, ok1] = request.security(ticker1, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
[n2, r2, h2, l2, t2, ok2] = request.security(ticker2, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
[n3, r3, h3, l3, t3, ok3] = request.security(ticker3, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
var table results = table.new(position.top_right, 6, 4, border_width = 1)
showRow(int row, string symbol, int nested, int run, float mh, float ml, int stamp, bool ready) =>
bool hasData = ready and not na(stamp)
color shade = hasData and run > 0 ? color.new(color.green, 75) : color.new(color.gray, 85)
table.cell(results, 0, row, symbol, bgcolor = shade, text_color = color.white)
table.cell(results, 1, row, hasData ? str.tostring(nested) : "No data", bgcolor = shade, text_color = color.white)
table.cell(results, 2, row, hasData ? str.tostring(run) : "No data", bgcolor = shade, text_color = color.white)
table.cell(results, 3, row, hasData ? str.tostring(mh, "#.########") : "N/A", bgcolor = shade, text_color = color.white)
table.cell(results, 4, row, hasData ? str.tostring(ml, "#.########") : "N/A", bgcolor = shade, text_color = color.white)
table.cell(results, 5, row, hasData ? str.format_time(stamp, "yyyy-MM-dd", "UTC") : "N/A", bgcolor = shade, text_color = color.white)
if barstate.islast
array<string> headings = array.from("Symbol", "Nested", "Mother run", "Mother high", "Mother low", "Bar date UTC")
for col = 0 to 5
table.cell(results, col, 0, array.get(headings, col), bgcolor = color.navy, text_color = color.white)
showRow(1, ticker1, n1, r1, h1, l1, t1, ok1)
showRow(2, ticker2, n2, r2, h2, l2, t2, ok2)
showRow(3, ticker3, n3, r3, h3, l3, t3, ok3)