---
id: "E:cAlgo.API.Internals.IAccount.Switched"
kind: "event"
type: "T:cAlgo.API.Internals.IAccount"
url: "https://help.ctrader.com/ctrader-algo/references/Account/IAccount/Switched/"
---

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

# IAccount.Switched

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

## Switched

Occurs when user switch his account.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
event Action<AccountSwitchedEventArgs> Switched;
```

Python:

```python
api.Account.Switched += handler  # handler(obj: AccountSwitchedEventArgs)
```

### Returns

`Action<AccountSwitchedEventArgs>` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Account.Switched += OnAccountSwitched;
}

private void OnAccountSwitched(AccountSwitchedEventArgs args)
{
    Print("Account switched from {0} to {1}", args.PreviousAccountNumber, args.CurrentAccountNumber);
}
```

Python:

```python
def on_start(self):
    api.Account.Switched += self.on_account_switched

def on_account_switched(self, args):
    api.Print(f"Account switched from {args.PreviousAccountNumber} to {args.CurrentAccountNumber}")
```

