Functions
array.new_bool()
Creates an array of `bool` elements with `size` elements, each set to `initial_value`. Both arguments are optional: leave `size` out for an empty array, and `initial_value` out for elements that start as `na`.
Syntax
array.new_bool(series int size, series bool initial_value) → series array<bool>
Arguments
size series int initial_value series bool Return Type
series array<bool> Example
//@lipi=2
indicator("array.new_bool Example", overlay=true)
// Remember whether each of the last 3 bars closed up
static array<bool> ups = array.new_bool(3, false)
array.shift(ups)
array.push(ups, close > open)
allUp = array.every(ups)
bgcolor(allUp ? color.new(color.green, 0.2) : na)