> For the complete documentation index, see [llms.txt](https://fto-2.gitbook.io/fto-indicators-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fto-2.gitbook.io/fto-indicators-docs/configure_indicator/set-buffer-shift.md).

# SetBufferShift

Sets the horizontal shift for a buffer.

## Syntax

```typescript
SetBufferShift(bufferIndex: number, shift: number): void
```

## Parameters

* `bufferIndex` - A number representing the index of the buffer.
* `shift` - A number representing the number of bars to shift the buffer.

## Return Value

This method does not return a value.

## Description

The `SetBufferShift` method sets the horizontal shift for a buffer. This allows you to offset the display of the buffer by a specified number of bars. Positive values shift the buffer to the right (into the future), while negative values shift it to the left (into the past).

## Example

```typescript
// Shift buffer 0 forward by 5 bars (into the future)
this.api.SetBufferShift(0, 5)

// Shift buffer 1 backward by 3 bars (into the past)
this.api.SetBufferShift(1, -3)

// Use shifting to create a predictive indicator
const predictionPeriod = 10
this.api.SetBufferShift(0, predictionPeriod)
```
