Skip to content

AccountSwitchedEventArgs.CurrentAccountNumber

property · AccountSwitchedEventArgs · cAlgo.API

DesktopCLICloud

Returns new account number.

Definition

public int CurrentAccountNumber {get;}
accountSwitchedEventArgs.CurrentAccountNumber: int

Returns int

Examples

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

private void OnAccountSwitched(AccountSwitchedEventArgs args)
{
    Print("Now trading on account {0}, balance: {1}", args.CurrentAccountNumber, Account.Balance);
}
def on_start(self):
    api.Account.Switched += self.on_account_switched

def on_account_switched(self, args):
    api.Print(f"Now trading on account {args.CurrentAccountNumber}, balance: {api.Account.Balance}")