Sidechair

linefill.delete()

Browse the reference

Clears the shading between two lines and leaves the lines themselves on the chart.

Try it in the editor

The band disappears and both lines stay exactly where they are. Deleting a fill that is already gone, or na, does nothing.

To remove the whole channel, delete the fill and then each line with line.delete().

Syntax

Pine Script
linefill.delete(id: series linefill) -> void
linefill.delete() -> void

Arguments

NameTypeDefaultDescription
idseries linefillrequiredThe linefill to remove; the two lines it joined stay on the chart.

Returns

Nothing.

Example

Pine ScriptDrop the band while volatility is wideOpen in editor
//@version=6
indicator("linefill.delete: squeeze band", overlay = true)
a = ta.atr(14)
wide = a > ta.sma(a, 50)
var line top = line.new(bar_index, high, bar_index + 1, high, extend = extend.right)
var line bot = line.new(bar_index, low, bar_index + 1, low, extend = extend.right)
var linefill band = na
line.set_xy1(top, bar_index - 20, ta.highest(high, 20))
line.set_xy2(top, bar_index, ta.highest(high, 20))
line.set_xy1(bot, bar_index - 20, ta.lowest(low, 20))
line.set_xy2(bot, bar_index, ta.lowest(low, 20))
if wide
    linefill.delete(band)
    band := na
else if na(band)
    band := linefill.new(top, bot, color.new(color.blue, 85))

See also

Runs on Sidechair