---
id: "M:cAlgo.API.ChartArea.FindObject(System.String)"
kind: "method"
type: "T:cAlgo.API.ChartArea"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/FindObject/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartArea.FindObject

Member of [ChartArea](https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/index.md).

## FindObject(string objectName)

Finds the chart object of the specified name.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
ChartObject FindObject(string objectName)
```

Python:

```python
chartArea.FindObject(objectName: str) -> ChartObject
```

### Parameters

- `objectName` (`string`, Python `str`): The name of the object.

### Returns

`ChartObject` — ChartObject.

### Examples

C#:

```csharp
// Draw a horizontal line.
Chart.DrawHorizontalLine("hLine", Symbol.Ask, Color.Red);

// Find the line that was drawn.
var obj = Chart.FindObject("hLine");
Print("Found object with name {0}", obj.Name);
```

Python:

```python
api.Chart.DrawHorizontalLine("hLine", api.Symbol.Ask, Color.Red)
obj = api.Chart.FindObject("hLine")
if obj is not None:
    api.Print(f"Found object with name {obj.Name}")
```

