Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.ta.highestbars
On this pageSignatureParametersReturnsExampleNotes

Core / Reference

alerta.ta.highestbars

TradingView-compatible spelling: ta.highestbars, runs without warnings

Returns the offset to the highest value of source over the last length bars, as Pine does: 0 on the current bar, negative before it (-3 = three bars ago). With a single argument — highestbars(length) — the source is high.

alerta.ta.highestbars(source, length) → series int

Parameters

NameTypeRequiredDefaultDescription
sourceseriesYes—Series of values to process.
lengthintYes—Number of bars (length).

Returns

series int

Example

alerta.ta.highestbars
const hh_off = highestbars(high, 20)

Notes

  • Returns offset, not absolute bar_index. For absolute index use highestindex().

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.