Lipi Reference
Lipi

Functions

array.new_linefill()

Creates an array of `linefill` 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 linefill 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_linefill(series int size, series linefill initial_value) → series array<linefill>
              

Arguments

size series int
initial_value series linefill

Return Type

series array<linefill>

Example


          //@lipi=2
indicator("array.new_linefill Example", overlay=true)
static array<linefill> fills = array.new_linefill(0)
if barstate.islast {
    l1 = line.new(bar_index[20], high[20], bar_index, high, color=color.green)
    l2 = line.new(bar_index[20], low[20], bar_index, low, color=color.red)
    array.push(fills, linefill.new(l1, l2, color.new(color.blue, 0.2)))
}