Skip to content
Algo Trade Analytics Docs

linefill - Pine Script Variable

Collections of linefill objects created by your script.

FieldTypeDescription
linefill.allarray<linefill>Returns an array filled with all the current linefill objects drawn by the script.
  • linefill.all: The array is read-only. Index zero of the array is the ID of the oldest object on the chart.
//@version=6
indicator("Linefill cleanup", overlay=true, max_lines_count=2, max_linefill_count=1)
var line top = na
var line bottom = na
var 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))