array.concat() - Pine Script Function
array.concat()
Section titled “array.concat()”Overview
Section titled “Overview”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.
Syntax
Section titled “Syntax”array.concat(id1, id2) → array<type>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id1 | any array type | The first array object. |
Returns
Section titled “Returns”The first array with merged elements from the second array.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("array.concat example")a = array.new_float(0,0)b = array.new_float(0,0)for i = 0 to 4array.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))