GetObjectProperty
Syntax
GetObjectProperty(
name: string,
index: ObjProp,
isStatic: boolean = false
): number | stringParameters
Return Value
Description
Example
Last updated
GetObjectProperty(
name: string,
index: ObjProp,
isStatic: boolean = false
): number | stringLast updated
// Get object coordinates
const time1 = this.api.GetObjectProperty("MyTrendLine", ObjProp.OBJPROP_TIME1);
const price1 = this.api.GetObjectProperty(
"MyTrendLine",
ObjProp.OBJPROP_PRICE1
);
console.log(`First point: Time=${time1}, Price=${price1}`);
// Get object color
const color = this.api.GetObjectProperty("MyTrendLine", ObjProp.OBJPROP_COLOR);
console.log(`Object color: ${color}`);
// Get text content
const text = this.api.GetObjectProperty("MyLabel", ObjProp.OBJPROP_TEXT);
console.log(`Label text: ${text}`);