Returns true when at least one item in a bool array is true.
The scan ends at the first true item. An empty array is false.
It is the any-of counterpart to array.every(), useful for alerting when at least one of several conditions held.
Syntax
array.some(id: array<bool>) -> series bool
array.some() -> series boolArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | array<bool> | required | The bool array to test. The call is true when at least one item is true. |
Returns
series bool: true when any item is true.
Example
//@version=6
indicator("array.some: recent gap", overlay = true)
var gaps = array.new_bool()
array.push(gaps, math.abs(open - close[1]) > ta.atr(14) * 0.5)
if array.size(gaps) > 4
array.shift(gaps)
bgcolor(array.some(gaps) ? color.new(color.yellow, 85) : na)See also
Runs on Sidechair