Skip to content
Algo Trade Analytics Docs

array.concat() - Pine Script Function

The function is used to merge two arrays. It pushes all elements from the second array to the first array, and returns the first array.

array.concat(id1, id2) → array<type>
NameTypeDescription
id1any array typeThe first array object.

The first array with merged elements from the second array.

//@version=6
indicator("array.concat example")
a = array.new_float(0,0)b = array.new_float(0,0)
for i = 0 to 4
array.push(a, high[i]) array.push(b, low[i])c = array.concat(a,b)
plot(array.size(a))
plot(array.size(b))
plot(array.size(c))