Skip to content
Algo Trade Analytics Docs

array.new_box() - Pine Script Function

The function creates a new array object of box type elements.

array.new_box(size, initial_value) → array<box>
NameTypeDescription
sizeseries intInitial size of an array. Optional. The default is 0.

The ID of an array object which may be used in other array.*() functions.

  • An array index starts from 0.
//@version=6
indicator("array.new_box example")
boxes = array.new_box()array.push(boxes,
box.new(time, close, time+2, low, xloc=xloc.bar_time))
plot(1)