Skip to content
Algo Trade Analytics Docs

array.shift() - Pine Script Function

The function removes an array’s first element and returns its value.

array.shift(id) → series <type>
NameTypeDescription
idany array typeAn array object.

The value of the removed element.

//@version=6
indicator("array.shift example")
a = array.new_float(5,high)removedEl = array.shift(a)
plot(array.size(a))
plot(removedEl)