Drawing / Reference
alerta.line.set_xloc
TradingView-compatible spelling: line.set_xloc, runs without warnings
Sets both x-coordinates of the line and the x-location they are read in (bar index or bar time) at once.
alerta.line.set_xloc(id, x1, x2, xloc) → voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
id | line handle | Yes | — | Target line handle. |
x1 | series int | Yes | — | New x of the first point, in the given xloc. |
x2 | series int | Yes | — | New x of the second point, in the given xloc. |
xloc | series string | Yes | — | xloc.bar_index | xloc.bar_time |
Returns
voidExample
alerta.line.set_xloc
ln = line.new(bar_index - 5, low, bar_index, high)if barstate.islast line.set_xloc(ln, time[5], time, xloc.bar_time)Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.