Sidechair

table.delete()

Browse the reference

Takes a table off the chart and frees its screen position.

Try it in the editor

The whole grid disappears and its slot is free for another table. After the call the variable still points at the deleted table, so assign na to it if later code tests na(t).

Use it when a table should show only under some condition, such as while a trade is open.

Syntax

Pine Script
table.delete(table_id: series table) -> void
table.delete() -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table to remove from the chart.

Returns

Nothing.

Example

Pine ScriptShow the table only on the last barOpen in editor
//@version=6
indicator("table.delete: conditional", overlay = true)
var table t = na
if barstate.islast and na(t)
    t := table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, "Live")
if not barstate.islast and not na(t)
    table.delete(t)
    t := na

See also

Runs on Sidechair