Sidechair

linefill

Browse the reference

The type of a colored band filling the space between two drawn lines, created with linefill.new().

Try it in the editor

A linefill variable refers to one shaded region bounded by two line objects. The fill follows the lines: when either line is moved the shaded area changes shape with it.

Use it for channels, ranges and cloud-like bands that must track hand-drawn trendlines, where plot() with fill() cannot be used because the edges are line objects and not series.

Remarks

  • Deleting a line removes the fill that depends on it. Deleting a linefill leaves both lines on the chart.

Example

Pine ScriptChannel between two linesOpen in editor
//@version=6
indicator("linefill type: channel", overlay = true)
if barstate.islast
    top = line.new(bar_index - 30, high[30], bar_index, high, color = color.green)
    bot = line.new(bar_index - 30, low[30], bar_index, low, color = color.red)
    linefill.new(top, bot, color.new(color.gray, 85))

See also

Runs on Sidechair