Cálculo del código de amortización del préstamo

Tengo un código de amortización de préstamo que encontré en línea e hice algunas modificaciones para satisfacer mis necesidades (C #). El problema que tengo es con el cálculo del interés mensual que se incluye en un bucle. No devuelve los valores correctos.

A continuación se muestra mi código (un poco largo):

 private void CalculateLoan()
        {
            // Make sure we use types that hold decimal places             
            DateTime payDate = DateTime.ParseExact(_startDate.Value, "yyyyMMdd", null);
            double interestRate = 0;
            double monthlyInterest = 0;
            double loanAmount;
            short amortizationTerm = 0;
            double currentBalance;
            double cummulativeInterest = 0;
            double monthlyPrincipal = 0;
            double cummulativePrincipal = 0;

            loanAmount = double.Parse(_principal.Value);
            currentBalance = loanAmount;
            interestRate = double.Parse(_interestRate.Value) * 0.01;
            amortizationTerm = short.Parse(_period.Value);

            // Calculate the monthly payment and round it to 2 decimal places           
            var monthlyPayment = ((interestRate / 12) / (1 - (Math.Pow((1 + (interestRate / 12)), -(amortizationTerm))))) * loanAmount;
            monthlyPayment = Math.Round(monthlyPayment, 2);

            // Storage List
            List<AmortPayment> amortPaymentList = new List<AmortPayment>();

            // Loop for amortization term (number of monthly payments)
            for (int j = 0; j < amortizationTerm; j++)
            {
                // Calculate monthly cycle
                monthlyInterest = currentBalance * interestRate;  **<-----problem here**
                monthlyPrincipal = monthlyPayment - monthlyInterest;
                currentBalance = currentBalance - monthlyPrincipal;

                if (j == amortizationTerm - 1 && currentBalance != monthlyPayment)
                {
                    // Adjust the last payment to make sure the final balance is 0
                    monthlyPayment += currentBalance;
                    currentBalance = 0;
                }

                // Reset Date
                payDate = payDate.AddMonths(1);
                // Add to cummulative totals
                cummulativeInterest += monthlyInterest;
                cummulativePrincipal += monthlyPrincipal;

                amortPaymentList.Add
                    (new AmortPayment 
                    { 
                      RowNumber = j + 1,
                      Date = payDate,
                      ScheduledPayment = Math.Round(monthlyPayment, 2),                                        
                      Interest = Math.Round(monthlyInterest, 2),
                      TotalRepayment = Math.Round(monthlyPayment + monthlyInterest, 2),
                      Balance = Math.Round(currentBalance, 2),   
                      TotalInterest = Math.Round(cummulativeInterest, 2),
                      TotalBalance = Math.Round(currentBalance + cummulativeInterest, 2)
                    });

                // Add values to SAP matrix          
                _rowNo.Value = (j + 1).ToString();
                _date.ValueEx = payDate.ToString("yyyyMMdd");
                _payment.Value = monthlyPayment.ToString();
                _interest.Value = monthlyInterest.ToString();
                _totalRepayment.Value = (monthlyPayment + monthlyInterest).ToString();
                _balancePrincipal.Value = currentBalance.ToString();
                _balanceInterest.Value = cummulativeInterest.ToString();
                _total.Value = (currentBalance + cummulativeInterest).ToString();

                _form.Freeze(true);
                oMatrix.AddRow();
                _form.Update();
                _form.Freeze(false);
            }
        }

¿Alguien puede decirme adónde voy mal con la declaración?monthlyInterest = currentBalance * interestRate;? Cualquier ayuda apreciada.

Respuestas a la pregunta(1)

Su respuesta a la pregunta