Sidechair

polyline.delete()

Browse the reference

Wipes a polyline, stroke and fill, from the chart.

Try it in the editor

The path and any fill disappear. Deleting a polyline that is already gone, or na, does nothing.

Delete the previous polyline before drawing its replacement to redraw a path on each update.

Syntax

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

Arguments

NameTypeDefaultDescription
idseries polylinerequiredThe polyline to remove, fill included. na is accepted and nothing happens.

Returns

Nothing.

Example

Pine ScriptRedraw a pathOpen in editor
//@version=6
indicator("polyline.delete: redraw", overlay = true)
var polyline pl_ = na
if barstate.islast
    polyline.delete(pl_)
    pl_ := polyline.new(array.from(chart.point.from_index(bar_index - 10, low), chart.point.now(high)))

See also

Runs on Sidechair