Skip to content
Algo Trade Analytics Docs

array.unshift() - Pine Script Function

The function inserts the value at the beginning of the array.

array.unshift(id, value) → void
NameTypeDescription
idany array typeAn array object.
//@version=6
indicator("array.unshift example")
a = array.new_float(5, 0)array.unshift(a, open)
plot(array.get(a, 0))