GetCurrentWindowIndex
Syntax
GetCurrentWindowIndex(): numberReturn Value
Description
Example
// Check if running in MainChart or indicator window
const windowIndex = this.api.GetCurrentWindowIndex();
if (windowIndex === 0) {
console.log("Running in MainChart");
} else {
console.log(`Running in indicator window ${windowIndex}`);
}
// Count objects in current window only
const count = this.api.GetObjectCount(false, this.api.GetCurrentWindowIndex());Last updated