Utilities / Reference
var
TradingView-compatible spelling: var, runs without warnings
Initializes a variable once and retains its value between bars. Use := to assign a new value to the existing variable.
var float previous = na → language constructReturns
language constructExample
//@version=6indicator("Persistent variable")var float previous = naprevious := closeplot(previous)Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.