Names and formulas

name = formula; operators; each name set once, in any order.

For AI tools: this page as Markdown · the whole language in one file

A name holds one value per bar: spread = high - low. Every name is a series, so spread has a value on every bar of the chart.

KindOperators
Maths+ - * / %
Comparing== != < <= > >=
Yes/noand or not
Pickingif c then a else b, or c ? a : b
  • Each name is set once. To change a value over time, use its value on the bar before: prev(name).
  • Order does not matter: a name may be used above the line that sets it.
  • A value may share its name with a built-in function: rsi = rsi(close, 14) is fine (rsi(...) is still the function).
  • Names are letters, digits and _, starting with a letter.
1body = abs(close - open)2range = high - low3plot(range > 0 ? body / range : none, "Body share")

See also: Picking a value: if and ? :, Looking back: prev, Empty values