Keywords
static
Declares a value that survives from one bar to the next. Without it, a declaration is made again on every bar, because your script is evaluated once per bar. Reassign a `static` value with `:=` and the new value carries forward. Its store is never cleared while the script runs, which is what separates it from `intra`. This is the only spelling: a declaration opening with `var` does not compile, and that mistake is common enough to check first when a declaration is rejected.
Syntax
static <data_type> <variable_name> = <expression>
Example
indicator("static Example - First Close", overlay=true)
// Store the first close price only once
static float firstClose = close
// Plot the first close price as a horizontal line
plot(firstClose, "First Close", color=color.blue)