Skip to content
Algo Trade Analytics Docs

box.all - Pine Script Variable

Returns an array filled with all the current boxes drawn by the script.

array<box>
  • The array is read-only. Index zero of the array is the ID of the oldest object on the chart.
//@version=6
indicator("box.all")//delete all boxes
box.new(time, open, time + 60 * 60 * 24, close, xloc=xloc.bar_time, border_style=line.style_dashed)a_allBoxes = box.all
if array.size(a_allBoxes) > 0
for i = 0 to
array.size(a_allBoxes) - 1 box.delete(array.get(a_allBoxes, i))