Sidechair

line.set_style()

Browse the reference

Switches a line between solid, dashed, dotted and arrow-headed drawing.

Try it in the editor

Pass a line.style_* constant: line.style_solid, line.style_dashed, line.style_dotted, line.style_arrow_left, line.style_arrow_right or line.style_arrow_both. An arrow head sits on the end its name points to.

Dashes suit projected or unconfirmed levels, solid suits confirmed ones, and arrows suit measured moves.

Syntax

Pine Script
line.set_style(id: series line, style: series string) -> void
line.set_style(style: series string) -> void

Arguments

NameTypeDefaultDescription
idseries linerequiredThe line whose dash pattern or arrow heads change.
styleseries stringrequiredline.style_solid, line.style_dashed, line.style_dotted, line.style_arrow_left, line.style_arrow_right or line.style_arrow_both.

Returns

Nothing.

Remarks

  • On Sidechair: dashed draws 6 pixels on and 4 off, dotted 2 on and 3 off, and with extend.right the right arrow head sits at the chart edge.

Example

Pine ScriptArrow for up bars, dotted for down barsOpen in editor
//@version=6
indicator("line.set_style: arrow or dots", overlay = true)
if bar_index % 15 == 0
    ln = line.new(bar_index, open, bar_index + 6, close)
    line.set_style(ln, close >= open ? line.style_arrow_right : line.style_dotted)

See also

Runs on Sidechair