> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Global constants

> Reference for the 3 constants of the global scope (the names with no namespace): false, na and true, each with its definition and an example.

> [!NOTE]
>
> Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: global · Entries: 3

## `false` (constant)

**Definition**

The bool value false. Comparisons and conditions produce it; it can also be written directly, as a default value or a constant.

**Type**

`const bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("false Example", overlay=true)
static bool crossedUp = false
if talib.crossover(close, talib.sma(close, 20)) {
    crossedUp := true
}
bgcolor(crossedUp ? color.new(color.green, 0.1) : na)
```

## `na` (constant)

**Definition**

Stands for a missing value. A series is `na` where there is no data yet, for example `close[1]` on the first bar, and a plot or colour that is `na` is simply not drawn.

Test for it with `na(x)`, never with `x == na`, and replace it with `nz(x, alternative)`.

**Type**

`const na`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("na Example", overlay=true)
// Plot only on up bars: na values leave gaps
plot(close > open ? close : na, title="Up Closes", color=color.green, style=plotStyle.linebr)
// na(close[1]) is true on the first bar only
bgcolor(na(close[1]) ? color.new(color.blue, 0.3) : na)
```

## `true` (constant)

**Definition**

The bool value true. Comparisons and conditions produce it; it can also be written directly, as a default value or a constant.

**Type**

`const bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("true Example", overlay=true)
showMA = true
plot(showMA ? talib.sma(close, 20) : na, title="SMA", color=color.blue)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.