pinescript中的函数na()是什么意思?

What is the meaning of the function na() in pinescript?

我找不到也不理解 pinescript 中的函数 na()。在下面的示例中,脚本针对特定的自定义时间范围打印 Heikin Ashi OHLC 柱线

//@version=4
strategy("[⚡TC⚡] Heikin Ashi Timeframes", overlay=false)

higherRes =input(title="Time 1", type=input.string, defval="90")

is_newbar(res) => 
    t = time(res) 
    not na(t) and (na(t[1]) or t > t[1])

o = security(syminfo.tickerid, higherRes, open)
h = security(syminfo.tickerid, higherRes, high) 
l = security(syminfo.tickerid, higherRes, low)
c = security(syminfo.tickerid, higherRes, close)

如果您阅读了文档,您会发现“Preventing na values, functions na and nz”部分描述了它的用途:

In addition, there is a simple function with one argument that returns a logical result called na. This function makes it possible to check if the argument is na or not. Check it out here.

link是函数说明:

na

Test value if it's a NaN.

na(x) → bool
na(x) → series[bool]

Returns

true if x is not a valid number (x is NaN), otherwise false.

See also

na fixnan nz