WindowFirstVisibleBar

Description

The WindowFirstVisibleBar method returns the index of the first visible bar in the current chart window.

Syntax

public WindowFirstVisibleBar(): number

Return Value

Returns a number representing the index of the first visible bar in the chart window.

Example

try {
  const firstVisibleBar = this.api.WindowFirstVisibleBar();
  console.log(`First visible bar index: ${firstVisibleBar}`);
} catch (error) {
  console.error("Failed to get first visible bar:", error.message);
}

Last updated