This second example calculates RSI and ATR for every bar, then formats their latest values for a two-column dashboard. The hidden plots expose the same unrounded series in TradingView's Data Window for comparison. The table uses one decimal for RSI and the symbol's tick precision for ATR, so rounding differences are expected.
Latest-value dashboard with a working position input and Data Window checkspinescript
//@version=6
indicator("RSI and ATR table", overlay = true)
string panelPosition = input.string(position.top_right, "Table position", options = [position.top_right, position.top_left, position.bottom_right, position.bottom_left])
int length = input.int(14, "Length", minval = 1)
float rsiValue = ta.rsi(close, length)
float atrValue = ta.atr(length)
plot(rsiValue, "RSI check", display = display.data_window)
plot(atrValue, "ATR check", display = display.data_window)
var table panel = table.new(panelPosition, 2, 4, bgcolor = color.navy, border_width = 1, border_color = color.gray)
if barstate.islast
string rsiText = na(rsiValue) ? "Waiting for data" : str.tostring(rsiValue, "#.0")
string atrText = na(atrValue) ? "Waiting for data" : str.tostring(atrValue, format.mintick)
string barText = barstate.isconfirmed ? "Closed" : "Developing"
table.cell(panel, 0, 0, "Metric", text_color = color.white)
table.cell(panel, 1, 0, "Latest value", text_color = color.white)
table.cell(panel, 0, 1, "RSI", text_color = color.white)
table.cell(panel, 1, 1, rsiText, text_color = color.white)
table.cell(panel, 0, 2, "ATR (price units)", text_color = color.white)
table.cell(panel, 1, 2, atrText, text_color = color.white)
table.cell(panel, 0, 3, "Bar", text_color = color.white)
table.cell(panel, 1, 3, barText, text_color = color.white)