Keywords
intra
The second of the two persistence keywords the grammar accepts, and the only other one. A value declared `intra` is kept while the current bar is still forming and is repeatedly recalculated, and it is reset the moment a new bar starts. Use it to carry something across recalculations of one bar; use `static` to carry something across bars. That is the whole difference between the two. `static` keeps its store for as long as the script runs, and `intra` has its store cleared at every new bar.
Syntax
intra <data_type> <variable_name> = <expression>
Example
indicator("intra Example", overlay=false)
// Declare a persistent variable that resets each new bar
intra int count = 0
// Increase count on each price update within the same bar
count := count + 1
// Plot the intrabar update count as a line
plot(count, title="Intrabar Execution Count", color=color.blue)