Arrays / Reference
alerta.array.binary_search_leftmost
TradingView-compatible spelling: array.binary_search_leftmost, runs without warnings
Returns the first matching index in a sorted numeric array, or the index immediately left of the insertion point.
alerta.array.binary_search_leftmost(id, value) → intParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
id | Array | Yes | — | Sorted array handle. |
value | float | Yes | — | Numeric value to search. |
Returns
intExample
alerta.array.binary_search_leftmost
arr = array.from(-2, 0, 1, 5, 9)idx = array.binary_search_leftmost(arr, 3)plot(idx, { title: "leftmost", pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.