Switches a line between solid, dashed, dotted and arrow-headed drawing.
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
line.set_style(id: series line, style: series string) -> void
line.set_style(style: series string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series line | required | The line whose dash pattern or arrow heads change. |
| style | series string | required | line.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.rightthe right arrow head sits at the chart edge.
Example
//@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