Skip to content
Algo Trade Analytics Docs

array.first() - Pine Script Function

Returns the array’s first element. Throws a runtime error if the array is empty.

array.first(id) → series <type>
NameTypeDescription
idany array typeAn array object.
//@version=6
indicator("array.first example")
arr = array.new_int(3, 10)
plot(array.first(arr))