# 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](https://fto-2.gitbook.io/fto-indicators-docs/types/object-property) \| 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](https://fto-2.gitbook.io/fto-indicators-docs/types/object-property) 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}`);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fto-2.gitbook.io/fto-indicators-docs/access_to_objects/get-object-property.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
