---
id: "T:cAlgo.API.TradeWatchTabDetachedEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/TradeWatchTabDetachedEventArgs/"
---

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

# TradeWatchTabDetachedEventArgs (class)

Provides data for plugin trade watch tab detached event.

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public class TradeWatchTabDetachedEventArgs
```

## Examples

C#:

```csharp
protected override void OnStart()
{
    var tab = TradeWatch.AddTab("My Tab");
    tab.Child = new TextBlock { Text = "Hello from plugin" };
    tab.Detached += OnTradeWatchTabDetached;
}

private void OnTradeWatchTabDetached(TradeWatchTabDetachedEventArgs args)
{
    Print("Tab {0} detached from the trade watch", args.TradeWatchTab.Title);
}
```

Python:

```python
def on_start(self):
    tab = api.TradeWatch.AddTab("My Tab")
    text_block = TextBlock()
    text_block.Text = "Hello from plugin"
    tab.Child = text_block
    tab.Detached += self.on_trade_watch_tab_detached

def on_trade_watch_tab_detached(self, args):
    api.Print(f"Tab {args.TradeWatchTab.Title} detached from the trade watch")
```

## Properties

- `public TradeWatchTab TradeWatchTab {get;}` — Detached tab. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/TradeWatchTabDetachedEventArgs/TradeWatchTab/index.md)

