---
id: "P:cAlgo.API.ChartObject.IsLocked"
kind: "property"
type: "T:cAlgo.API.ChartObject"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/IsLocked/"
---

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

# ChartObject.IsLocked

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

## IsLocked

Gets or sets if the object is locked or not, user can't move locked objects unless unlocked.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: Created and kept with all its properties, but never drawn: the CLI displays no chart.
- Cloud: Created and kept with all its properties, but never drawn: the cloud displays no chart.

C#:

```csharp
bool IsLocked {get; set;}
```

Python:

```python
chartObject.IsLocked: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
var line = Chart.DrawHorizontalLine("support", Bars.LowPrices.LastValue, Color.Green);
line.IsInteractive = true;
line.IsLocked = true;
Print("Line is locked: {0}", line.IsLocked);
```

Python:

```python
line = api.Chart.DrawHorizontalLine("support", api.Bars.LowPrices.LastValue, Color.Green)
line.IsInteractive = True
line.IsLocked = True
api.Print(f"Line is locked: {line.IsLocked}")
```

