Variables
barstate.isfirst
Your script is being evaluated on the first bar of the chart. On every bar after that one, this reads false. A script is evaluated once per bar, in order, so this holds on the earliest run only.
Example
indicator("First Bar Check", overlay=true)
static float firstBarClose = barstate.isfirst ? close : na
plot(firstBarClose)
Type
series bool