Skip to content
Algo Trade Analytics Docs

array.from() - Pine Script Function

The function takes a variable number of arguments with one of the types: int, float, bool, string, label, line, color, box, table, linefill, and returns an array of the corresponding type.

array.from(arg0, arg1, ...) → array<type>
NameTypeDescription
arg0
arg1
<arg…_type>Array arguments.

The array element’s value.

  • This function can accept up to 4,000 ‘int’, ‘float’, ‘bool’, or ‘color’ arguments. For all other types, including user-defined types, the limit is 999.
//@version=6
indicator("array.from_example", overlay = false)
arr = array.from("Hello", "World!") // arr (array<string>) will contain 2 elements: {Hello}, {World!}.
plot(close)