Skip to content

TransactionType

enum cAlgo.API Since 5.2

DesktopCLICloud

Represents the different types of account transactions.

Definition

public enum TransactionType

Namespace: cAlgo.API · Group: Transactions

Examples

var deposits = Transactions.Where(transaction => transaction.Type == TransactionType.Deposit).Sum(transaction => transaction.Amount);
var withdrawals = Transactions.Where(transaction => transaction.Type == TransactionType.Withdrawal).Sum(transaction => transaction.Amount);
Print("Deposits: {0}, withdrawals: {1}", deposits, withdrawals);
deposits = sum(transaction.Amount for transaction in api.Transactions if transaction.Type == TransactionType.Deposit)
withdrawals = sum(transaction.Amount for transaction in api.Transactions if transaction.Type == TransactionType.Withdrawal)
api.Print(f"Deposits: {deposits}, withdrawals: {withdrawals}")

Values

Name Value Description
Deposit 0 Represents a deposit transaction.
Withdrawal 1 Represents a withdrawal transaction.

See also