Changes the stroke thickness of a line in pixels.
Use whole numbers from 1 upward. The width is in screen pixels, so it stays the same when you zoom the chart.
A weight that depends on a condition turns a plain level into a signal: thin when quiet, heavy when it matters.
Syntax
line.set_width(id: series line, width: series int) -> void
line.set_width(width: series int) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series line | required | The line whose stroke thickness changes. |
| width | series int | required | Thickness in pixels as a whole number. 1 is the thinnest; larger values stand out more on a busy chart. |
Returns
Nothing.
Example
//@version=6
indicator("line.set_width: weight by volume", overlay = true)
vavg = ta.sma(volume, 20)
if bar_index % 10 == 0
ln = line.new(bar_index, low, bar_index + 8, low, color = color.teal)
line.set_width(ln, volume > vavg ? 4 : 1)See also
Runs on Sidechair