linefill - Pine Script Variable
linefill
Section titled “linefill”Overview
Section titled “Overview”Collections of linefill objects created by your script.
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
linefill.all | array<linefill> | Returns an array filled with all the current linefill objects drawn by the script. |
Remarks
Section titled “Remarks”linefill.all: The array is read-only. Index zero of the array is the ID of the oldest object on the chart.
Example
Section titled “Example”//@version=6indicator("Linefill cleanup", overlay=true, max_lines_count=2, max_linefill_count=1)
var line top = navar line bottom = navar linefill ribbon = na
if barstate.isfirst top := line.new(bar_index, high, bar_index + 10, high, extend=extend.right, color=color.new(color.teal, 0)) bottom := line.new(bar_index, low, bar_index + 10, low, extend=extend.right, color=color.new(color.orange, 0)) ribbon := linefill.new(top, bottom, color.new(color.teal, 85))
if barstate.islast fills = linefill.all if array.size(fills) > 0 for i = 0 to array.size(fills) - 1 linefill.delete(array.get(fills, i))