IndicatorBuffers

Sets the number of data buffers used by the indicator.

Syntax

IndicatorBuffers(bufferCount: number): void

Parameters

  • bufferCount - A number representing the count of data buffers needed by the indicator.

Return Value

This method does not return a value.

Description

The IndicatorBuffers method specifies how many data buffers the indicator will use. Each buffer represents a series of values that can be displayed on the chart. For example, a simple moving average uses one buffer, while Bollinger Bands use three buffers (middle line, upper band, lower band).

Example

// For a simple indicator with one line
this.api.IndicatorBuffers(1)

// For Bollinger Bands (middle, upper, lower)
this.api.IndicatorBuffers(3)

// For MACD (MACD line, signal line, histogram)
this.api.IndicatorBuffers(3)

Last updated