Sidechair

line.* constants

Browse the reference

Styles for lines drawn with line.new and box borders: solid, dashed, dotted, and three arrowhead variants.

Try it in the editor

line.style_* constants go in the style argument of line.new, line.set_style, and the border_style argument of box.new. line.style_solid is the default. line.style_arrow_left, line.style_arrow_right and line.style_arrow_both add an arrowhead at the first point, the second point, or both.

Boxes accept only solid, dashed and dotted; arrow styles apply to lines.

Constants

NameValueDescription
line.style_arrow_bothA solid line with an arrowhead at both ends.
line.style_arrow_leftA solid line with an arrowhead at its first point.
line.style_arrow_rightA solid line with an arrowhead at its second point.
line.style_dashedA dashed line.
line.style_dottedA dotted line.
line.style_solidA solid line; the default.

Remarks

  • Arrowheads sit at the line's own endpoints. A line extended with extend.right still has its arrowhead at the second point.

Example

Pine ScriptArrow from low to highOpen in editor
//@version=6
indicator("Arrow line", overlay = true)
if barstate.islast
    line.new(bar_index - 50, low[50], bar_index, high, color = color.blue, width = 2, style = line.style_arrow_right)
    line.new(bar_index - 50, close[50], bar_index, close, color = color.gray, style = line.style_dotted)
plot(close, "Close", color.new(color.gray, 70))

See also

Runs on Sidechair