Arrays / Reference
alerta.array.binary_search
TradingView-compatible spelling: array.binary_search, runs without warnings
Searches a sorted numeric array and returns found index, or -1.
alerta.array.binary_search(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
arr = array.new_float(0)array.push(arr, 1)array.push(arr, 3)array.push(arr, 5)idx = array.binary_search(arr, 3)Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.