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 intParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | series | Yes | — | Series of values to process. |
length | int | Yes | — | Number of bars (length). |
Returns
series intExample
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.