Lipi Reference
Lipi

Functions

array.new_table()

Creates an array of `table` IDs with `size` elements, each set to `initial_value`. Arrays of drawing IDs are the usual way to keep a limited history of drawings: push each new table and delete the oldest when the array grows past a limit. Both arguments are optional; elements start as `na` when `initial_value` is left out.

Syntax

                array.new_table(series int size, series table initial_value) → series array<table>
              

Arguments

size series int
initial_value series table

Return Type

series array<table>

Example


          //@lipi=2
indicator("array.new_table Example", overlay=true)
static array<table> tables = array.new_table(0)
if barstate.islast {
    t = table.new(position.top_right, 1, 1, bgcolor=color.gray)
    table.cell(t, 0, 0, text="Close: " + str.tostring(math.round(close, 2)))
    array.push(tables, t)
}