Sharekhan.domain.TermDeposit.CalculateRealizedProfits C# (CSharp) Méthode

CalculateRealizedProfits() public méthode

public CalculateRealizedProfits ( ITransactionCollection listOfTransactions ) : double
listOfTransactions ITransactionCollection
Résultat double
        public override double CalculateRealizedProfits(ITransactionCollection listOfTransactions)
        {
            Price realizedProfit = new Price(0);
            foreach (Transaction transaction in listOfTransactions.TransactionList)
            {
                realizedProfit += transaction.EffectiveTransactionAmount();
            }

            return realizedProfit.Value;
        }

Usage Example

Exemple #1
0
        public void ShouldBeAbleToGiveRealizedProfitForSinglePayoutTermDeposit()
        {
            Price depositPrice = new Price(10000);
            Price withdrawalPrice = new Price(2100);

            TermDeposit termDeposit = new TermDeposit(new Term(4), new Price(10000), new Symbol("CITI"), "Term Deposit", new InterestRate(10), -1);
            Transaction termDepositTransaction = new TermDepositTransaction(new DateTime(2006, 11, 6), termDeposit, new Price(10000.00));

            ITransactionCollection transactionCollection = new TransactionCollection();
            transactionCollection.Add(termDepositTransaction);

            Assert.AreEqual(0, termDeposit.CalculateRealizedProfits(transactionCollection));
        }
All Usage Examples Of Sharekhan.domain.TermDeposit::CalculateRealizedProfits