var - Pine Script Keyword
Overview
Section titled “Overview”var is the keyword used for assigning and one-time initializing of the variable.
Syntax
Section titled “Syntax”var variable_name = expressionExample
Section titled “Example”//@version=6indicator("Var keyword example")var a = closevar b = 0.0var c = 0.0var green_bars_count = 0if close > open var x = close b := x green_bars_count := green_bars_count + 1 if green_bars_count >= 10 var y = close c := yplot(a)plot(b)plot(c)