ChartWindowFind

Description

The ChartWindowFind method finds the subwindow number that contains the specified indicator.

Syntax

public ChartWindowFind(chartId: number, name: string): number

Parameters

  • chartId: A number representing the chart ID

  • name: A string representing the indicator name

Return Value

Returns a number representing the subwindow number. Returns -1 if the indicator is not found.

Example

try {
    const chartId = this.api.GetCurrentChartId()
    const windowNumber = this.api.ChartWindowFind(chartId, 'RSI')
    if (windowNumber !== -1) {
        console.log(`RSI indicator found in subwindow ${windowNumber}`)
    } else {
        console.log('RSI indicator not found')
    }
} catch (error) {
    console.error('Failed to find indicator window:', error.message)
}

Last updated