Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.line.set_xloc
On this pageSignatureParametersReturnsExample

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) → void

Parameters

NameTypeRequiredDefaultDescription
idline handleYes—Target line handle.
x1series intYes—New x of the first point, in the given xloc.
x2series intYes—New x of the second point, in the given xloc.
xlocseries stringYes—xloc.bar_index | xloc.bar_time

Returns

void

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.