Skip to content
Algo Trade Analytics Docs

array.pop() - Pine Script Function

The function removes the last element from an array and returns its value.

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

The value of the removed element.

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