> 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-index-chart-overlay.md).

# SetIndexChartOverlay

Sets overlay mode for a buffer in an oscillator indicator.

## Syntax

```typescript
SetIndexChartOverlay(index: number, chartOverlay: boolean): void
```

## Parameters

* `index` - Buffer index.
* `chartOverlay` - `true`: draw the buffer on the main chart; `false`: draw in the oscillator subwindow (default).

## Return Value

This method does not return a value.

## Description

For indicators in a separate oscillator window ([`SetOutputWindow`](/fto-indicators-docs/configure_indicator/set-output-window.md) → `TOutputWindow.SEPARATE_WINDOW`), enables per-buffer overlay: with `chartOverlay: true`, the buffer at `index` is rendered on the main chart instead of the oscillator subwindow.

Call in [`Init()`](/fto-indicators-docs/indicators/indicator-structure/init.md) after [`SetIndexBuffer`](/fto-indicators-docs/configure_indicator/set-index-buffer.md). Invalid `index` throws **`StrangeError`**.

## Example

```typescript
public Init(): void {
  this.api.SetOutputWindow(TOutputWindow.SEPARATE_WINDOW);
  this.api.IndicatorBuffers(2);

  this.rsiBuffer = this.api.CreateIndexBuffer();
  this.api.SetIndexBuffer(0, this.rsiBuffer);
  this.api.SetIndexChartOverlay(0, false);

  this.signalBuffer = this.api.CreateIndexBuffer();
  this.api.SetIndexBuffer(1, this.signalBuffer);
  this.api.SetIndexChartOverlay(1, true);
}
```

## Related Methods

* [`SetOutputWindow`](/fto-indicators-docs/configure_indicator/set-output-window.md)
* [`SetIndexVisibility`](/fto-indicators-docs/configure_indicator/set-index-visibility.md)
