Paste the indicator into the TradingView Pine Editor and add it to a standard intraday chart, such as 60 minutes. Set three exchange-qualified symbols in Settings. The table shows the last completed daily bar available through each request. Default symbols are examples only. Blue rows match a proximity or break rule; every row includes its reference levels and observation date.
Three explicit symbol inputs; prior daily range; completed daily close; no orders or alert calls.pine
//@version=6
indicator("Support resistance list: completed daily ranges", overlay = true)
int length = input.int(20, "Prior daily bars", minval = 2, maxval = 252)
float tolerance = input.float(0.5, "Near-level tolerance (%)", minval = 0, maxval = 10, step = 0.1)
string symbol1 = input.symbol("NASDAQ:AAPL", "Symbol 1")
string symbol2 = input.symbol("NASDAQ:MSFT", "Symbol 2")
string symbol3 = 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.")
scan() =>
float resistance = ta.highest(high, length)[2]
float support = ta.lowest(low, length)[2]
bool ready = not na(high[length + 1]) and not na(low[length + 1])
[close[1], close[2], resistance, support, time[1], ready]
[c1, p1, r1, s1, t1, ok1] = request.security(symbol1, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
[c2, p2, r2, s2, t2, ok2] = request.security(symbol2, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
[c3, p3, r3, s3, t3, ok3] = request.security(symbol3, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
var table results = table.new(position.top_right, 7, 4, border_width = 1)
showRow(int row, string symbol, float c, float previous, float r, float s, int stamp, bool ready) =>
bool valid = ready and not na(c) and not na(previous) and not na(stamp) and s > 0 and r > s
float ds = valid ? 100 * (c - s) / s : na
float dr = valid ? 100 * (r - c) / r : na
bool nearS = valid and c >= s and c <= r and c <= (s + s * tolerance / 100)
bool nearR = valid and c <= r and c >= s and c >= (r - r * tolerance / 100)
bool breakUp = valid and c > r and previous <= r
bool breakDown = valid and c < s and previous >= s
string state = not valid ? "No data / invalid range" : breakUp ? "Break up" : breakDown ? "Break down" : nearS and nearR ? "Near both" : nearS ? "Near support" : nearR ? "Near resistance" : "No match"
color shade = valid and (breakUp or breakDown or nearS or nearR) ? color.new(color.blue, 70) : color.new(color.gray, 85)
array<string> cells = array.from(symbol, valid ? str.format_time(stamp, "yyyy-MM-dd", "UTC") : "N/A", valid ? str.tostring(s, "#.########") : "N/A", valid ? str.tostring(r, "#.########") : "N/A", valid ? str.tostring(ds, "#.####") : "N/A", valid ? str.tostring(dr, "#.####") : "N/A", state)
for col = 0 to 6
table.cell(results, col, row, array.get(cells, col), bgcolor = shade, text_color = color.white)
if barstate.islast
array<string> headers = array.from("Symbol", "Daily open UTC", "Support", "Resistance", "Above S %", "Below R %", "State")
for col = 0 to 6
table.cell(results, col, 0, array.get(headers, col), bgcolor = color.navy, text_color = color.white)
showRow(1, symbol1, c1, p1, r1, s1, t1, ok1)
showRow(2, symbol2, c2, p2, r2, s2, t2, ok2)
showRow(3, symbol3, c3, p3, r3, s3, t3, ok3)