> ## 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.

# extend constants

> Reference for the 4 constants of the extend namespace: extend.both, extend.left, extend.none and extend.right, each with its definition and an example.

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

## `extend` (library)

**Definition**

Named constants that control whether line/box drawings extend past their endpoints (none, left, right, both).

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("extend Library Example", overlay=true)
if barstate.islast {
    line.new(bar_index[20], low[20], bar_index, low, color=color.red, extend=extend.right)
    line.new(bar_index[20], high[20], bar_index, high, color=color.green, extend=extend.both)
}
```

## `extend.both` (constant)

**Definition**

Extend the drawing in both directions.

**Type**

`const string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("extend.both Example", overlay=true)
if barstate.islast {
    line.new(bar_index[20], low[20], bar_index, high, color=color.blue, extend=extend.both)
}
```

## `extend.left` (constant)

**Definition**

Extend the drawing to the left of the first point.

**Type**

`const string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("extend.left Example", overlay=true)
if barstate.islast {
    line.new(bar_index[20], low[20], bar_index, high, color=color.blue, extend=extend.left)
}
```

## `extend.none` (constant)

**Definition**

Do not extend the drawing past its endpoints.

**Type**

`const string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("extend.none Example", overlay=true)
if barstate.islast {
    line.new(bar_index[20], low[20], bar_index, high, color=color.blue, extend=extend.none)
}
```

## `extend.right` (constant)

**Definition**

Extend the drawing to the right of the second point.

**Type**

`const string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("extend.right Example", overlay=true)
if barstate.islast {
    line.new(bar_index[20], low[20], bar_index, high, color=color.blue, extend=extend.right)
}
```


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