Empty values

Not enough history, a division by zero, or none.

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

A value is empty before there is enough history (a 20-bar average on bar 5), after a division by zero, or where it was set to none (Pine's na).

  • Maths with an empty value stays empty.
  • A comparison with one is false.
  • max and min skip empty values, so max(prev(stop), x) works from the first bar.
  • empty(x) tests for it; fallback(x, y) swaps it for y (Pine's na(x) and nz(x, y)).
  • An empty value draws nothing: a plot has a gap there.
1r = rsi(close, 14)2plot(r > 70 ? r : none, "Overbought only", style = dots)3plot(fallback(prev(close), close), "Previous close")

See also: empty, fallback, none