Functions
na()
Tests whether a value is absent. It takes any type and gives back a bool. This is the test a script needs often, because so much reads `na` when there is nothing behind it: an instrument property that is unknown, an orderflow figure on a bar with no footprint data, a colour function handed an `na`.
Syntax
na(series <any_type> value) → series bool
Arguments
value required series The value to test. Required. Any type is accepted. Return Type
series bool Example
indicator("NA Example", overlay=true)
val = close > open ? close : na
isNa = na(val)
plot(val, color=color.blue, title="Value (May be NA)")
plot(isNa ? 1 : 0, color=color.red, title="Is NA (1 = True, 0 = False)")