Beispiel #1
0
        public async Task GetAccount()
        {
            AccountInfo.Clear();
            // Account info
            TTAccount account = await _client.GetAccountAsync();

            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Id), account.Id));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Group), account.Group));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.AccountingType), account.AccountingType));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Name), account.Name));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Email), account.Email));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Comment), account.Comment));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Registered), account.Registered.ToString("u")));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.IsBlocked), account.IsBlocked));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.IsReadonly), account.IsReadonly));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.IsValid), account.IsValid));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.IsWebApiEnabled), account.IsWebApiEnabled));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Leverage), account.Leverage));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Balance), account.Balance));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.BalanceCurrency), account.BalanceCurrency));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Equity), account.Equity));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.Margin), account.Margin));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.MarginLevel), account.MarginLevel));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.MarginCallLevel), account.MarginCallLevel));
            AccountInfo.Add(new KeyValuePair <string, object>(nameof(account.StopOutLevel), account.StopOutLevel));

            IsAccountCash = account.AccountingType == TTAccountingTypes.Cash;
            IsAccountNet  = account.AccountingType == TTAccountingTypes.Net;
        }