Sidechair

label.all

Browse the reference

A snapshot array of every label the script currently has on the chart.

Try it in the editor

Loop over it to move, restyle or delete every label at once, including labels whose variables are out of scope. Its length never exceeds the label limit set by max_labels_count.

It is a snapshot taken when the name is read. Items you remove from this array do not delete the drawings; call label.delete() on each.

Type

array<label>

Remarks

  • On Sidechair: label.all is built fresh on every use, in creation order, so it always holds the labels that are on the chart at that moment.

Example

Pine ScriptDrop labels below the last closeOpen in editor
//@version=6
indicator("label.all: prune below close", overlay = true)
if bar_index % 10 == 0
    label.new(bar_index, high, str.tostring(high, "#.##"), style = label.style_label_down)
if barstate.islast
    for l in label.all
        if label.get_y(l) < close
            label.delete(l)

See also

Runs on Sidechair