> For the complete documentation index, see [llms.txt](https://fto-2.gitbook.io/fto-indicators-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fto-2.gitbook.io/fto-indicators-docs/access_to_objects/get-object-property.md).

# GetObjectProperty

Retrieves a property value from a chart object.

## Syntax

```typescript
GetObjectProperty(
  name: string,
  index: ObjProp | number,
  isStatic: boolean = false
  ): number | string
```

## Parameters

| Parameter | Type                                                               | Description                                             |
| --------- | ------------------------------------------------------------------ | ------------------------------------------------------- |
| name      | string                                                             | The name of the object                                  |
| index     | [ObjProp](/fto-indicators-docs/types/object-property.md) \| number | The property identifier                                 |
| isStatic  | boolean                                                            | Optional. Whether the object is static (default: false) |

## Return Value

Returns either a `number` or `string` depending on the property type.

## Description

The `GetObjectProperty` method retrieves a property value from a specified chart object. It can return either numeric or string properties depending on the property identifier provided.

See [ObjProp](/fto-indicators-docs/types/object-property.md) for a complete list of available object properties.

## Example

```typescript
// 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}`);

// Mouse lock: 1 = locked, 0 = unlocked
const locked = this.api.GetObjectProperty("MyTrendLine", ObjProp.OBJPROP_LOCKED);
```
