array.new_table() - Pine Script Function
array.new_table()
Section titled “array.new_table()”Overview
Section titled “Overview”The function creates a new array object of table type elements.
Syntax
Section titled “Syntax”array.new_table(size, initial_value) → array<table>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| size | series int | Initial size of an array. Optional. The default is 0. |
Returns
Section titled “Returns”The ID of an array object which may be used in other array.*() functions.
Remarks
Section titled “Remarks”- An array index starts from 0.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("table array")tables = array.new_table()array.push(tables,table.new(position = position.top_left, rows = 1, columns = 2, bgcolor = color.yellow, border_width=1))plot(1)