simple - Pine Script Type
simple
Section titled “simple”Overview
Section titled “Overview”The simple keyword explicitly assigns the “simple” type qualifier to variables and function parameters. Variables and parameters that use the “simple” qualifier can reference values established at the beginning of a script’s execution that do not change later.
Remarks
Section titled “Remarks”- To learn more, see our User Manual’s section on type qualifiers.
Example
Section titled “Example”//@version=6indicator("can't change simple to series")//@variable A variable declared as "simple float" with a value of 5.0.simple float myVar = 5.0// This reassignment causes an error.// The `close` variable returns a "series float" value. Since `myVar` is restricted to "simple" values, it cannot// change its qualifier to "series".myVar := closeplot(myVar)