Skip to content

IAccount.Switched

event · IAccount · cAlgo.API.Internals

DesktopCLICloud

Occurs when user switch his account.

Definition

event Action<AccountSwitchedEventArgs> Switched;
api.Account.Switched += handler  # handler(obj: AccountSwitchedEventArgs)

Examples

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

private void OnAccountSwitched(AccountSwitchedEventArgs args)
{
    Print("Account switched from {0} to {1}", args.PreviousAccountNumber, args.CurrentAccountNumber);
}
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}")