---
id: "T:cAlgo.API.ApplicationDraggables"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Application/ApplicationDraggables/"
---

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

# ApplicationDraggables (interface)

Represents collection of application draggables.

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

- CLI: Add returns a draggable that is never displayed; Remove sends nothing to the application.
- Cloud: Add returns a draggable that is never displayed; Remove sends nothing to the application.

## Definition

```csharp
public interface ApplicationDraggables
```

Available since cAlgo.API 5.2.

## Examples

C#:

```csharp
public partial class TestExample : Robot
{
   private const string Label = "Draggable";

   protected override void OnStart()
   {
       var openPositionButton = new Button {Text = "Open Position"};

       openPositionButton.Click += _ => ExecuteMarketOrder(TradeType.Buy, SymbolName, Symbol.VolumeInUnitsMin, Label);

       var closePositionsButton = new Button {Text = "Close Position"};

       closePositionsButton.Click += _ => Positions.Find(Label)?.Close();

       var panel = new StackPanel {Orientation = Orientation.Vertical, BackgroundColor = Color.Red};

       panel.AddChild(openPositionButton);
       panel.AddChild(closePositionsButton);

       var draggable = Application.Draggables.Add();

       draggable.ShowGrip = true;
       draggable.Child = panel;

       draggable.LocationChanged += args => Print($"Draggable Location Changed: {args.Draggable.X}, {args.Draggable.Y}");
   }
}
```

Python:

```python
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *

# Import trading wrapper functions
from robot_wrapper import *

from System import Action

class Test():
    Label = "Draggable"
    def on_start(self):
        openPositionButton = Button()
        openPositionButton.Text = "Open Position"
        openPositionButton.Click += self.open_position

        closePositionsButton = Button()
        closePositionsButton.Text = "Close Position"
        closePositionsButton.Click += self.close_position

        panel = StackPanel()
        panel.Orientation = Orientation.Vertical
        panel.BackgroundColor = Color.Red

        panel.AddChild(openPositionButton)
        panel.AddChild(closePositionsButton)

        draggable = api.Application.Draggables.Add()
        draggable.ShowGrip = True
        draggable.Child = panel

        draggable.LocationChanged += lambda args: print(f"Draggable Location Changed: {args.Draggable.X}, {args.Draggable.Y}")

    def open_position(self, args):
        api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, api.Symbol.VolumeInUnitsMin, self.Label)

    def close_position(self, args):
        position = api.Positions.Find(self.Label)

        if position is not None:
            position.Close()
```

config.json:

```json
{
  "AccessRights": "None"
}
```

## Methods

- `ApplicationDraggable Add()` — Adds a draggable to application. [details](https://help.ctrader.com/ctrader-algo/references/Application/ApplicationDraggables/Add/index.md)
- `void Remove(ApplicationDraggable draggable)` — Removes a draggable from application. [details](https://help.ctrader.com/ctrader-algo/references/Application/ApplicationDraggables/Remove/index.md)

## Properties

- `int Count {get;}` — Gets count of draggables. [details](https://help.ctrader.com/ctrader-algo/references/Application/ApplicationDraggables/Count/index.md)

