CreateIndexBuffer

Creates a new buffer for storing indicator values.

Syntax

CreateIndexBuffer(): TIndexBuffer

Parameters

This method does not take any parameters.

Return Value

Returns a TIndexBuffer object that can be used to store indicator values.

Description

The CreateIndexBuffer method creates a new buffer for storing indicator values. This buffer can then be assigned to a specific index using the SetIndexBuffer method. Each buffer represents a series of values that can be displayed on the chart.

See TIndexBuffer for more information about working with indicator buffers.

Example

// Create a buffer for a simple moving average
const maBuffer = this.api.CreateIndexBuffer();

// Assign the buffer to index 0
this.api.SetIndexBuffer(0, maBuffer);

// get value from some index
this.maBuffer.getValue(0);

// set value for some index
this.maBuffer.setValue(0, 100.15);

Last updated