---
id: "E:cAlgo.API.ApplicationDraggable.LocationChanged"
kind: "event"
type: "T:cAlgo.API.ApplicationDraggable"
url: "https://help.ctrader.com/ctrader-algo/references/Application/ApplicationDraggable/LocationChanged/"
---

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

# ApplicationDraggable.LocationChanged

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

## LocationChanged

Occurs when the draggable's location is changed.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never displayed: starts at X=0, Y=0; position changes are not applied and LocationChanged never fires.
- Cloud: Never displayed: starts at X=0, Y=0; position changes are not applied and LocationChanged never fires.

C#:

```csharp
event Action<ApplicationDraggableLocationChangedEventArgs> LocationChanged;
```

Python:

```python
applicationDraggable.LocationChanged += handler  # handler(obj: ApplicationDraggableLocationChangedEventArgs)
```

### Returns

`Action<ApplicationDraggableLocationChangedEventArgs>` — 

Available since cAlgo.API 5.2.

### Examples

C#:

```csharp
protected override void OnStart()
{
    var draggable = Application.Draggables.Add();
    draggable.Child = new TextBlock { Text = SymbolName };
    draggable.LocationChanged += OnDraggableLocationChanged;
}

private void OnDraggableLocationChanged(ApplicationDraggableLocationChangedEventArgs args)
{
    Print("Draggable moved to {0}, {1}", args.Draggable.X, args.Draggable.Y);
}
```

Python:

```python
def on_start(self):
    draggable = api.Application.Draggables.Add()
    textBlock = TextBlock()
    textBlock.Text = api.SymbolName
    draggable.Child = textBlock
    draggable.LocationChanged += self.on_draggable_location_changed

def on_draggable_location_changed(self, args):
    api.Print(f"Draggable moved to {args.Draggable.X}, {args.Draggable.Y}")
```

