Skip to content
Algo Trade Analytics Docs
Pine library page — review pending. This page is preserved for compatibility but is not part of the reviewed search index. Check the official Pine Script v6 reference before relying on its explanation, signature, or example.

:= - Pine Script Operator

Reassignment operator. It is used to assign a new value to a previously declared variable.

<var_name> := <new_value>
//@version=6indicator("My script")myVar = 10if close > open    // Modifies the existing global scope `myVar` variable by changing its value from 10 to 20.    myVar := 20    // Creates a new `myVar` variable local to the `if` condition and unreachable from the global scope.    // Does not affect the `myVar` declared in global scope.    myVar = 30plot(myVar)