Sidechair

simple

Browse the reference

The qualifier for a value known on the first bar that never changes after it, such as syminfo.ticker or an input.

Try it in the editor

A simple value is computed once, on the first bar, and stays the same for the whole run. syminfo.ticker, timeframe.period, timeframe.multiplier and syminfo.mintick are simple. The qualifier sits between input and series: const < input < simple < series.

Some arguments are typed simple because the runtime has to know them before it processes any bars, such as the seconds passed to timeframe.from_seconds() when you want a simple result. A series value cannot be passed there, but a const, input or simple value can.

Remarks

  • Write simple before a type to be explicit, as in simple string tf = timeframe.period. A variable assigned from a simple expression becomes simple on its own.
  • A simple value cannot depend on a bar's price. If a value changes from bar to bar, it is series.
  • On Sidechair: a simple qualifier written in a declaration is accepted and not enforced. Arguments to built-in functions that need a simple value are checked.

Example

Pine ScriptA simple value from the chartOpen in editor
//@version=6
indicator("Simple values", overlay = true)
simple int mins = int(timeframe.in_seconds() / 60)
plot(close, "Close", color.gray)
if barstate.islast
    label.new(bar_index, high, syminfo.ticker + " " + str.tostring(mins) + "m")

See also

Runs on Sidechair