Styles for lines drawn with line.new and box borders: solid, dashed, dotted, and three arrowhead variants.
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
| Name | Value | Description |
|---|---|---|
line.style_arrow_both | A solid line with an arrowhead at both ends. | |
line.style_arrow_left | A solid line with an arrowhead at its first point. | |
line.style_arrow_right | A solid line with an arrowhead at its second point. | |
line.style_dashed | A dashed line. | |
line.style_dotted | A dotted line. | |
line.style_solid | A solid line; the default. |
Remarks
- Arrowheads sit at the line's own endpoints. A line extended with
extend.rightstill has its arrowhead at the second point.
Example
//@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