//@version=5
indicator("Watchlist Table", overlay = true)
s1 = input.symbol("SPY")
s2 = input.symbol("QQQ")
s3 = input.symbol("DIA")
c1 = request.security(s1, timeframe.period, close)
c2 = request.security(s2, timeframe.period, close)
c3 = request.security(s3, timeframe.period, close)
var table t = table.new(position.top_right, 2, 4, border_width = 1)
if barstate.islast
table.cell(t, 0, 0, "Symbol", text_color = color.gray, text_size = size.small)
table.cell(t, 1, 0, "Last", text_color = color.gray, text_size = size.small)
table.cell(t, 0, 1, s1, text_color = color.white, text_size = size.small)
table.cell(t, 1, 1, str.tostring(c1, "#.##"), text_color = color.white, text_size = size.small)
table.cell(t, 0, 2, s2, text_color = color.white, text_size = size.small)
table.cell(t, 1, 2, str.tostring(c2, "#.##"), text_color = color.white, text_size = size.small)
table.cell(t, 0, 3, s3, text_color = color.white, text_size = size.small)
table.cell(t, 1, 3, str.tostring(c3, "#.##"), text_color = color.white, text_size = size.small)