---
id: "E:cAlgo.API.TradeWatchTab.Attached"
kind: "event"
type: "T:cAlgo.API.TradeWatchTab"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TradeWatch/TradeWatchTab/Attached/"
---

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

# TradeWatchTab.Attached

Member of [TradeWatchTab](https://help.ctrader.com/ctrader-algo/references/Plugin/TradeWatch/TradeWatchTab/index.md).

## Attached

Occurs when tab attached.

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.

C#:

```csharp
event Action<TradeWatchTabAttachedEventArgs> Attached;
```

Python:

```python
tradeWatchTab.Attached += handler  # handler(obj: TradeWatchTabAttachedEventArgs)
```

### Returns

`Action<TradeWatchTabAttachedEventArgs>` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    var tab = TradeWatch.AddTab("My Tab");
    tab.Attached += OnTabAttached;
}

private void OnTabAttached(TradeWatchTabAttachedEventArgs args)
{
    Print("Tab {0} attached", args.TradeWatchTab.Title);
}
```

Python:

```python
def on_start(self):
    tab = api.TradeWatch.AddTab("My Tab")
    tab.Attached += self.on_tab_attached

def on_tab_attached(self, args):
    api.Print(f"Tab {args.TradeWatchTab.Title} attached")
```

